--- - name: Start provisioning of instances command: > metalsmith {{ extra_args }} deploy --no-wait {% for cap_name, cap_value in capabilities.items() %} --capability {{ cap_name }}={{ cap_value }} {% endfor %} {% for nic in nics %} {% for nic_type, nic_value in nic.items() %} --{{ nic_type }} {{ nic_value }} {% endfor %} {% endfor %} {% if root_size %} --root-disk-size {{ root_size }} {% endif %} {% for ssh_key in ssh_public_keys %} --ssh-public-key {{ ssh_key }} {% endfor %} --image {{ image }} --hostname {{ instance.hostname }} {% if netboot %} --netboot {% endif %} {% if user_name %} --user-name {{ user_name }} {% endif %} {% if resource_class %} --resource-class {{ resource_class }} {% endif %} {% for node in candidates %} --candidate {{ node }} {% endfor %} when: state == 'present' vars: candidates: "{{ instance.candidates | default(metalsmith_candidates) }}" capabilities: "{{ instance.capabilities | default(metalsmith_capabilities) }}" extra_args: "{{ instance.extra_args | default(metalsmith_extra_args) }}" image: "{{ instance.image | default(metalsmith_image) }}" netboot: "{{ instance.netboot | default(metalsmith_netboot) }}" nics: "{{ instance.nics | default(metalsmith_nics) }}" resource_class: "{{ instance.resource_class | default(metalsmith_resource_class) }}" root_size: "{{ instance.root_size | default(metalsmith_root_size) }}" ssh_public_keys: "{{ instance.ssh_public_keys | default(metalsmith_ssh_public_keys) }}" state: "{{ instance.state | default('present') }}" user_name: "{{ instance.user_name | default(metalsmith_user_name) }}" with_items: "{{ metalsmith_instances }}" loop_control: label: "{{ instance.hostname or instance }}" loop_var: instance - name: Wait for provisioning of instances command: > metalsmith {{ metalsmith_extra_args }} wait {% if metalsmith_provisioning_timeout %} --timeout {{ metalsmith_provisioning_timeout }} {% endif %} {% for instance in metalsmith_instances %} {% if (instance.state | default('present')) == 'present' %} {{ instance.hostname }} {% endif %} {% endfor %}