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

---
- hosts: lilikhost
vars_prompt:
- name: container_name
prompt: 'what container should be destroyed?'
private: no
- name: confirm1
prompt: 'are you sure you want to delete the container?'
private: no
- name: confirm2
prompt: 'if you really are sure, enter "cthulhu" backwards'
private: no
tasks:
- block:
- name: shutdown lxc container
lxc_container:
name: "{{ container_name }}"
state: stopped
- name: clean LVM volume
command: "dd if=/dev/zero of=/dev/sysvg/vm_{{ container_name }} bs=1M count=128"
- name: delete lxc container
lxc_container:
name: "{{ container_name }}"
state: absent
when: "confirm1 == 'yes' and confirm2 == 'uhluhtc'"