Skip to content

Commit d27586e

Browse files
committed
improve playbook idempotency
1 parent 01cc062 commit d27586e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

olvm/configure_secondary_nic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
- name: Get network interface
8888
ansible.builtin.set_fact:
8989
interface: "{{ item }}"
90-
with_items: "{{ ansible_interfaces | reject('==', 'lo') }}"
91-
when: ansible_facts[item].macaddress == mac_addr
90+
with_items: "{{ ansible_interfaces | select('match', '^(ens|enp|eth)') | list }}"
91+
when: ansible_facts[item].macaddress is defined and ansible_facts[item].macaddress == mac_addr
9292

9393
- name: Assign static IP
9494
community.general.nmcli:

olvm/create_instance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@
425425
oracle.oci.oci_compute_instance:
426426
id: "{{ hostvars[item]['instance_ocid'] }}"
427427
state: absent
428-
loop: "{{ ansible_play_hosts_all | difference(['localhost']) }}"
428+
loop: "{{ groups['all'] | difference(['localhost']) }}"
429429

430430
- name: Delete the vlan
431431
oracle.oci.oci_network_vlan:

olvm/ovirt_add_hosts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See LICENSE.TXT for details.
66

77
- name: Add KVM hosts to a Cluster in the Engine server
8-
hosts: olvm
8+
hosts: engine
99
vars_files:
1010
- default_vars.yml
1111
- oci_vars.yml

0 commit comments

Comments
 (0)