diff --git a/contrib/network-storage/heketi/README.md b/contrib/network-storage/heketi/README.md index aa1b656e5c4..fb67a43d745 100644 --- a/contrib/network-storage/heketi/README.md +++ b/contrib/network-storage/heketi/README.md @@ -14,3 +14,5 @@ ansible-playbook --ask-become -i inventory/sample/k8s_heketi_inventory.yml contr ``` ansible-playbook --ask-become -i inventory/sample/k8s_heketi_inventory.yml contrib/network-storage/heketi/heketi-tear-down.yml ``` + +Add `--extra-vars "heketi_remove_lvm=true"` to the command above to remove LVM packages from the system diff --git a/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 index 43048c6b679..764de5efaaf 100644 --- a/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 +++ b/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 @@ -56,7 +56,7 @@ "serviceAccountName": "heketi-service-account", "containers": [ { - "image": "heketi/heketi:7", + "image": "heketi/heketi:9", "imagePullPolicy": "Always", "name": "deploy-heketi", "env": [ diff --git a/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 index 247f1fd9dcf..cd7466ae5aa 100644 --- a/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 +++ b/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 @@ -68,7 +68,7 @@ "serviceAccountName": "heketi-service-account", "containers": [ { - "image": "heketi/heketi:7", + "image": "heketi/heketi:9", "imagePullPolicy": "Always", "name": "heketi", "env": [ diff --git a/contrib/network-storage/heketi/roles/tear-down-disks/defaults/main.yml b/contrib/network-storage/heketi/roles/tear-down-disks/defaults/main.yml new file mode 100644 index 00000000000..c07ba2d2387 --- /dev/null +++ b/contrib/network-storage/heketi/roles/tear-down-disks/defaults/main.yml @@ -0,0 +1,2 @@ +--- +heketi_remove_lvm: false diff --git a/contrib/network-storage/heketi/roles/tear-down-disks/tasks/main.yml b/contrib/network-storage/heketi/roles/tear-down-disks/tasks/main.yml index c1816969413..9ace96e6274 100644 --- a/contrib/network-storage/heketi/roles/tear-down-disks/tasks/main.yml +++ b/contrib/network-storage/heketi/roles/tear-down-disks/tasks/main.yml @@ -14,6 +14,8 @@ when: "ansible_os_family == 'Debian'" - name: "Get volume group information." + environment: + PATH: "{{ ansible_env.PATH }}:/sbin" # Make sure we can workaround RH / CentOS conservative path management become: true shell: "pvs {{ disk_volume_device_1 }} --option vg_name | tail -n+2" register: "volume_groups" @@ -21,12 +23,16 @@ changed_when: false - name: "Remove volume groups." + environment: + PATH: "{{ ansible_env.PATH }}:/sbin" # Make sure we can workaround RH / CentOS conservative path management become: true command: "vgremove {{ volume_group }} --yes" with_items: "{{ volume_groups.stdout_lines }}" loop_control: { loop_var: "volume_group" } - 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 command: "pvremove {{ disk_volume_device_1 }} --yes" ignore_errors: true @@ -36,11 +42,11 @@ yum: name: "lvm2" state: "absent" - when: "ansible_os_family == 'RedHat'" + when: "ansible_os_family == 'RedHat' and heketi_remove_lvm" - name: "Remove lvm utils (Debian)" become: true apt: name: "lvm2" state: "absent" - when: "ansible_os_family == 'Debian'" + when: "ansible_os_family == 'Debian' and heketi_remove_lvm"