Skip to content

Instantly share code, notes, and snippets.

@mrlesmithjr
Created April 19, 2017 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlesmithjr/2051ac365967a8450e838894160f8a94 to your computer and use it in GitHub Desktop.
Save mrlesmithjr/2051ac365967a8450e838894160f8a94 to your computer and use it in GitHub Desktop.
[maas_non_provisioned]
{% for host in (maas_machines['stdout']|from_json) %}
{% if groups['maas_deployed_machines'] is defined %}
{% if host['fqdn'] not in groups['maas_deployed_machines'] %}
{{ host['fqdn'] }}
{% elif host['hostname'] not in groups['maas_deployed_machines'] %}
{{ host['hostname'] }}
{% endif %}
{% elif groups['maas_deployed_machines'] is not defined %}
{{ host['fqdn'] }}
{{ host['hostname'] }}
{% endif %}
{% endfor %}
{% if kvm_vms_list is defined %}
{% if groups['maas_deployed_machines'] is defined %}
{% for kvm_vm in kvm_vms_list %}
{% if kvm_vm not in groups['maas_deployed_machines'] %}
{{ kvm_vm }}
{% endif %}
{% endfor %}
{% elif groups['maas_deployed_machines'] is not defined %}
{% for kvm_vm in kvm_vms_list %}
{{ kvm_vm }}
{% endfor %}
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment