@ -14,6 +14,8 @@
when : "ansible_os_family == 'Debian'"
when : "ansible_os_family == 'Debian'"
- name : "Get volume group information."
- name : "Get volume group information."
environment:
PATH : "{{ ansible_env.PATH }}:/sbin" # Make sure we can workaround RH / CentOS conservative path management
become : true
become : true
shell : "pvs {{ disk_volume_device_1 }} --option vg_name | tail -n+2"
shell : "pvs {{ disk_volume_device_1 }} --option vg_name | tail -n+2"
register : "volume_groups"
register : "volume_groups"
@ -21,12 +23,16 @@
changed_when : false
changed_when : false
- name : "Remove volume groups."
- name : "Remove volume groups."
environment:
PATH : "{{ ansible_env.PATH }}:/sbin" # Make sure we can workaround RH / CentOS conservative path management
become : true
become : true
command : "vgremove {{ volume_group }} --yes"
command : "vgremove {{ volume_group }} --yes"
with_items : "{{ volume_groups.stdout_lines }}"
with_items : "{{ volume_groups.stdout_lines }}"
loop_control : { loop_var : "volume_group" }
loop_control : { loop_var : "volume_group" }
- name : "Remove physical volume from cluster disks."
- name : "Remove physical volume from cluster disks."
environment:
PATH : "{{ ansible_env.PATH }}:/sbin" # Make sure we can workaround RH / CentOS conservative path management
become : true
become : true
command : "pvremove {{ disk_volume_device_1 }} --yes"
command : "pvremove {{ disk_volume_device_1 }} --yes"
ignore_errors : true
ignore_errors : true
@ -36,11 +42,11 @@
yum:
yum:
name : "lvm2"
name : "lvm2"
state : "absent"
state : "absent"
when : "ansible_os_family == 'RedHat'"
when : "ansible_os_family == 'RedHat' and heketi_remove_lvm "
- name : "Remove lvm utils (Debian)"
- name : "Remove lvm utils (Debian)"
become : true
become : true
apt:
apt:
name : "lvm2"
name : "lvm2"
state : "absent"
state : "absent"
when : "ansible_os_family == 'Debian'"
when : "ansible_os_family == 'Debian' and heketi_remove_lvm "