object: "{{item.vm}}"
with_items: "{{containers}}"
- name: Update DNS entries
- when: not skip_dns and inventory_hostname == 'localhost'
+ when: not skip_dns and inventory_hostname == 'localhost' and item.meta|default(false)
with_items: "{{containers}}"
ansible.builtin.command:
argv: [
'-s', "{{name_server}}",
]
- name: Update Jenkins nodes
- when: not skip_jenkins and inventory_hostname == 'localhost'
+ when: item.jenkins|default(false) and not skip_jenkins and inventory_hostname == 'localhost'
with_items: "{{containers}}"
vars:
node_name: "{{item.jenkins.node_name|default(item.lxd.name|default(item.vm.name))}}"