I have a couple of lists defined in group_vars along with a lookup to determine the defined IP for the ilom:
…ansbile/inventory/group_vars/.yml
ilom_gateway:
- 10.224.64.1
- 10.85.0.1
- 10.234.50.161
ilom_mask:
- 255.255.248.0
- 255.255.254.0
- 255.255.255.224
ilom_ip: “{{ lookup(‘dig’, ‘mgmt-’ + ansible_local.system_facts.host_serial + ‘.example.com’) }}”
I need a way, in the playbook, to test and compare the ilom_gateway values to the ilom_ip – if it’s in the same subnet use that gateway and mask to configure the ilom. My question is, how? Would it be better to combine the lists (gw:mask) and split then test?