You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
483B

  1. ---
  2. - hosts: localhost
  3. vars:
  4. vms: "{
  5. {% for hostname in groups.vms %}
  6. {{hostname|to_json}}: {{
  7. {
  8. 'provider': hostvars[hostname].provider,
  9. 'server_type': hostvars[hostname].server_type,
  10. } | to_json }},
  11. {% endfor %} }"
  12. tasks:
  13. - name: terraform inventory vars
  14. copy:
  15. content:
  16. vms: "{{vms}}"
  17. groups: {}
  18. dest: "{{playbook_dir}}/inventory.auto.tfvars.json"