Playbooks to a new Lilik
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.

25 lines
857 B

  1. ---
  2. - hosts: lilikhost
  3. vars_prompt:
  4. - name: container_name
  5. prompt: 'what container should be destroyed?'
  6. private: no
  7. - name: confirm1
  8. prompt: 'are you sure you want to delete the container?'
  9. private: no
  10. - name: confirm2
  11. prompt: 'if you really are sure, enter "cthulhu" backwards'
  12. private: no
  13. tasks:
  14. - block:
  15. - name: shutdown lxc container
  16. lxc_container:
  17. name: "{{ container_name }}"
  18. state: stopped
  19. - name: clean LVM volume
  20. command: "dd if=/dev/zero of=/dev/sysvg/vm_{{ container_name }} bs=1M count=128"
  21. - name: delete lxc container
  22. lxc_container:
  23. name: "{{ container_name }}"
  24. state: absent
  25. when: "confirm1 == 'yes' and confirm2 == 'uhluhtc'"