create_vms.yaml 575 B

123456789101112131415161718192021222324
  1. ---
  2. - debug:
  3. var: vms
  4. - fail:
  5. msg: "The vms fact is not set. Run build_vm_list task from this role"
  6. when:
  7. - vms is none
  8. - name: check if the template already exists
  9. ovirt_templates_facts:
  10. pattern: "name={{ template_name }} and storage.name={{ openshift_ovirt_data_store }}"
  11. auth: "{{ ovirt_auth }}"
  12. # Upload the template if it doesn't exist already
  13. - import_role:
  14. name: oVirt.image-template
  15. when:
  16. not ovirt_templates
  17. - import_role:
  18. name: oVirt.vm-infra
  19. - name: print all created vms that are in the inventory
  20. debug:
  21. var: hostvars