diff --git a/ansible/roles/vm_set/tasks/main.yml b/ansible/roles/vm_set/tasks/main.yml index 1285584347a..7d5b4475dac 100644 --- a/ansible/roles/vm_set/tasks/main.yml +++ b/ansible/roles/vm_set/tasks/main.yml @@ -175,7 +175,7 @@ home_path: "{{ getent_passwd[ansible_user][4] }}" when: home_path is not defined - # root_path is supposed to be absolute path. + # root_path is supposed to be absolute path. - set_fact: root_path: "{{ home_path + '/' + root_path }}" when: "not '{{ root_path }}'.startswith('/')" @@ -265,6 +265,10 @@ set_fact: VM_targets={{ VM_hosts | filter_vm_targets(topology['VMs'], VM_base) | sort }} when: topology['VMs'] is defined + - name: Set fallback default value for VM_targets + set_fact: VM_targets={{ [] }} + when: VM_targets is not defined + - name: Set vm configuration properties when configuration is defined set_fact: vm_properties="{{ configuration | expand_properties(configuration_properties) }}" when: configuration is defined