delete-project.yml 933 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ---
  2. # Pass variables to this playbook on the command line (-e):
  3. #
  4. # project: the name of the project (role.name)
  5. #
  6. - name: Ensure an ICHP-lookalike project is gone.
  7. hosts: workstation.lab.example.com
  8. gather_subset: min
  9. become: no
  10. tasks:
  11. - name: Ensure that the parameters are specified.
  12. ansible.builtin.assert:
  13. that:
  14. - project is defined
  15. success_msg: "OK, got all parameters, continuing."
  16. fail_msg: "FATAL: You must specify the name of the project to delete using the \"project\" variable."
  17. # Get auth info, and test comms.
  18. - include_role:
  19. name: check-env
  20. apply:
  21. tags:
  22. - check
  23. tags:
  24. - check
  25. - include_role:
  26. name: create-ichp-project
  27. apply:
  28. tags:
  29. - delete
  30. vars:
  31. role:
  32. state: absent
  33. name: "{{ project }}"
  34. tags:
  35. - delete
  36. ...