summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorGreg Swift <gregswift@gmail.com>2017-10-31 16:15:38 -0500
committerGreg Swift <gregswift@gmail.com>2017-10-31 16:15:38 -0500
commit7551d06153710a596a6e2db6b88d65ba2b31a9e7 (patch)
tree5620cdf61ce3ceac36cd8e7240d24646053ce15d /playbooks
parentb393201a048ca7b73b1892d8222390954dca4841 (diff)
downloadopenshift-7551d06153710a596a6e2db6b88d65ba2b31a9e7.tar.gz
openshift-7551d06153710a596a6e2db6b88d65ba2b31a9e7.tar.bz2
openshift-7551d06153710a596a6e2db6b88d65ba2b31a9e7.tar.xz
openshift-7551d06153710a596a6e2db6b88d65ba2b31a9e7.zip
Cleans up additional artifacts in uninstall. Closes 3082
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/adhoc/uninstall.yml69
1 files changed, 55 insertions, 14 deletions
diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml
index 07f10d48c..4e74ee5ee 100644
--- a/playbooks/adhoc/uninstall.yml
+++ b/playbooks/adhoc/uninstall.yml
@@ -151,6 +151,14 @@
- lbr0
- vlinuxbr
- vovsbr
+
+ - name: Remove virtual devices
+ command: nmcli delete device "{{ item }}"
+ failed_when: False
+ with_items:
+ - tun0
+ - docker0
+
when: openshift_remove_all | default(true) | bool
- shell: atomic uninstall "{{ item }}"-master-api
@@ -264,12 +272,30 @@
- "{{ directories.results | default([]) }}"
- files
+ - shell: systemctl daemon-reload
+ changed_when: False
+
+ - name: restart container-engine
+ service: name=container-engine state=stopped enabled=no
+ failed_when: false
+ register: container_engine
+
+ - name: restart docker
+ service: name=docker state=stopped enabled=no
+ failed_when: false
+ when: not (container_engine | changed)
+ register: l_docker_restart_docker_in_pb_result
+ until: not l_docker_restart_docker_in_pb_result | failed
+ retries: 3
+ delay: 30
+
- name: Remove remaining files
file: path={{ item }} state=absent
with_items:
- /etc/ansible/facts.d/openshift.fact
- /etc/openshift
- /etc/openshift-sdn
+ - /etc/pki/ca-trust/source/anchors/openshift-ca.crt
- /etc/sysconfig/atomic-openshift-node
- /etc/sysconfig/atomic-openshift-node-dep
- /etc/sysconfig/openshift-node-dep
@@ -284,23 +310,38 @@
- /etc/systemd/system/origin-node-dep.service
- /etc/systemd/system/origin-node.service
- /etc/systemd/system/origin-node.service.wants
+ - /var/lib/docker
+
+ - name: Rebuild ca-trust
+ command: update-ca-trust
+
+ - name: Reset Docker proxy configuration
+ lineinfile:
+ state=absent
+ dest=/etc/sysconfig/docker
+ regexp='(NO_PROXY|HTTP_PROXY|HTTPS_PROXY)=.*'
+
+ - name: Reset Docker registry configuration
+ lineinfile:
+ state=absent
+ dest=/etc/sysconfig/docker
+ regexp='(ADD_REGISTRY|BLOCK_REGISTRY|INSECURE_REGISTRY)=.*'
+
+ - name: Detect Docker storage configuration
+ shell: vgs -o name | grep docker
+ register: docker_vg_name
+ failed_when: false
+ changed_when: false
- - shell: systemctl daemon-reload
- changed_when: False
+ - name: Wipe out Docker storage contents
+ command: vgremove -f {{ item }}
+ with_items: "{{ docker_vg_name.stdout_lines }}"
+ when: docker_vg_name.rc == 0
- - name: restart container-engine
- service: name=container-engine state=restarted
- failed_when: false
- register: container_engine
+ - name: Wipe out Docker storage configuration
+ file: path=/etc/sysconfig/docker-storage state=absent
+ when: docker_vg_name.rc == 0
- - name: restart docker
- service: name=docker state=restarted
- failed_when: false
- when: not (container_engine | changed)
- register: l_docker_restart_docker_in_pb_result
- until: not l_docker_restart_docker_in_pb_result | failed
- retries: 3
- delay: 30
- hosts: masters
become: yes