From 008aa1b39a8c27cf227c87cdf225182a18a992e6 Mon Sep 17 00:00:00 2001 From: Avesh Agarwal Date: Fri, 14 Aug 2015 17:26:45 -0400 Subject: Updated tutorial reset file and made following chages: 1. Included openshift clean up 2. Renamed file to atomic_openshift_tutorial_reset.yml 3. docker service is not not stopped 4. docker containers and images are removed 5. /etc/openshift-sdn are removed too now --- .../adhoc/atomic_openshift_tutorial_reset.yml | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 playbooks/adhoc/atomic_openshift_tutorial_reset.yml (limited to 'playbooks/adhoc/atomic_openshift_tutorial_reset.yml') diff --git a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml new file mode 100644 index 000000000..91159ad8e --- /dev/null +++ b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml @@ -0,0 +1,68 @@ +# This deletes *ALL* Docker images, and uninstalls OpenShift and +# Atomic Enterprise RPMs. It is primarily intended for use +# with the tutorial as well as for developers to reset state. + +- hosts: + - OSEv3:children + + sudo: yes + + tasks: + - service: name={{ item }} state=stopped + with_items: + - openshift-master + - openshift-node + - openvswitch + - atomic-enterprise-master + - atomic-enterprise-node + + - yum: name={{ item }} state=absent + with_items: + - openvswitch + - atomic-enterprise + - atomic-enterprise-master + - atomic-enterprise-node + - atomic-enterprise-sdn-ovs + - tuned-profiles-atomic-enterprise-node + - openshift + - openshift-master + - openshift-node + - openshift-sdn-ovs + - tuned-profiles-openshift-node + + - shell: systemctl reset-failed + changed_when: False + + - shell: systemctl daemon-reload + changed_when: False + + - shell: find /var/lib/atomic-enterprise/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true + changed_when: False + + - shell: find /var/lib/openshift/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true + changed_when: False + + - shell: docker ps -a -q | xargs docker stop + changed_when: False + + - shell: docker ps -a -q| xargs docker rm + changed_when: False + + - shell: docker images -q |xargs docker rmi + changed_when: False + + - file: path={{ item }} state=absent + with_items: + - /var/lib/atomic-enterprise + - /etc/sysconfig/atomic-enterprise + - /etc/atomic-enterprise + - /etc/openshift + - /etc/openshift-sdn + - /root/.kube + - /etc/sysconfig/openshift + - /var/lib/openshift + + - user: name={{ item }} state=absent remove=yes + with_items: + - alice + - joe -- cgit v1.2.3 From 0e94fa986dd928888c36d2fbef71359c0b9b05d2 Mon Sep 17 00:00:00 2001 From: Avesh Agarwal Date: Mon, 17 Aug 2015 11:01:41 -0400 Subject: Updated to include origin and atomic-openshift RPMs re-factoring to include all origin, AE and openshift products. For back-word compatibility, older openshift and AE naming is retained too. --- .../adhoc/atomic_openshift_tutorial_reset.yml | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'playbooks/adhoc/atomic_openshift_tutorial_reset.yml') diff --git a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml index 91159ad8e..1200caa2a 100644 --- a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml +++ b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml @@ -10,15 +10,29 @@ tasks: - service: name={{ item }} state=stopped with_items: + - openvswitch + - origin-master + - origin-node + - atomic-openshift-master + - atomic-openshift-node - openshift-master - openshift-node - - openvswitch - atomic-enterprise-master - atomic-enterprise-node - yum: name={{ item }} state=absent with_items: - openvswitch + - origin + - origin-master + - origin-node + - origin-sdn-ovs + - tuned-profiles-origin-node + - atomic-openshift + - atomic-openshift-master + - atomic-openshift-node + - atomic-openshift-sdn-ovs + - tuned-profiles-atomic-openshift-node - atomic-enterprise - atomic-enterprise-master - atomic-enterprise-node @@ -36,6 +50,9 @@ - shell: systemctl daemon-reload changed_when: False + - shell: find /var/lib/origin/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true + changed_when: False + - shell: find /var/lib/atomic-enterprise/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true changed_when: False @@ -53,14 +70,22 @@ - file: path={{ item }} state=absent with_items: - - /var/lib/atomic-enterprise - - /etc/sysconfig/atomic-enterprise - - /etc/atomic-enterprise - - /etc/openshift - /etc/openshift-sdn - /root/.kube - - /etc/sysconfig/openshift + - /etc/origin + - /etc/atomic-enterprise + - /etc/openshift + - /var/lib/origin - /var/lib/openshift + - /var/lib/atomic-enterprise + - /etc/sysconfig/origin-master + - /etc/sysconfig/origin-node + - /etc/sysconfig/atomic-openshift-master + - /etc/sysconfig/atomic-openshift-node + - /etc/sysconfig/openshift-master + - /etc/sysconfig/openshift-node + - /etc/sysconfig/atomic-enterprise-master + - /etc/sysconfig/atomic-enterprise-node - user: name={{ item }} state=absent remove=yes with_items: -- cgit v1.2.3 From d565411ae9f2080c7c575744099fe5f79de2bb55 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 27 Aug 2015 21:32:17 -0400 Subject: adhoc/tutorial_reset: Don't error out if there are no Docker images I'd like this playbook to always work. --- playbooks/adhoc/atomic_openshift_tutorial_reset.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'playbooks/adhoc/atomic_openshift_tutorial_reset.yml') diff --git a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml index 1200caa2a..3e22f8f2d 100644 --- a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml +++ b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml @@ -61,12 +61,15 @@ - shell: docker ps -a -q | xargs docker stop changed_when: False + failed_when: False - shell: docker ps -a -q| xargs docker rm changed_when: False + failed_when: False - shell: docker images -q |xargs docker rmi changed_when: False + failed_when: False - file: path={{ item }} state=absent with_items: -- cgit v1.2.3 From 61ba47474f12fb83e9e40f2a1f0a47fd5d393457 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 27 Aug 2015 22:19:27 -0400 Subject: adhoc/tutorial_reset: Also delete etcd and data I needed this because I forgot to override openshift_hostname, and it found the wrong hostname, which then leaked into etcd certs, which caused the master to fail to start. --- playbooks/adhoc/atomic_openshift_tutorial_reset.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'playbooks/adhoc/atomic_openshift_tutorial_reset.yml') diff --git a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml index 3e22f8f2d..54d3ea278 100644 --- a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml +++ b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml @@ -19,10 +19,12 @@ - openshift-node - atomic-enterprise-master - atomic-enterprise-node + - etcd - yum: name={{ item }} state=absent with_items: - openvswitch + - etcd - origin - origin-master - origin-node @@ -89,6 +91,8 @@ - /etc/sysconfig/openshift-node - /etc/sysconfig/atomic-enterprise-master - /etc/sysconfig/atomic-enterprise-node + - /etc/etcd + - /var/lib/etcd - user: name={{ item }} state=absent remove=yes with_items: -- cgit v1.2.3 From 0c5e2522e44aee9309336049633eb82531f997b6 Mon Sep 17 00:00:00 2001 From: Brenton Leanhardt Date: Tue, 20 Oct 2015 14:38:22 -0400 Subject: Improvements to uninstallation playbook This is related to https://trello.com/c/314nwSvt/58-3-uninstall-playbook The original atomic_openshift_tutorial_reset.yml now calls the uninstall playbook for most parts. All the originally functionally is still intact. The main differences between the two playbooks is that the uninstall playbook is careful only to delete content that ansible originally installed. --- .../adhoc/atomic_openshift_tutorial_reset.yml | 77 +--------------------- 1 file changed, 3 insertions(+), 74 deletions(-) (limited to 'playbooks/adhoc/atomic_openshift_tutorial_reset.yml') diff --git a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml index 54d3ea278..c14d08e87 100644 --- a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml +++ b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml @@ -1,6 +1,9 @@ # This deletes *ALL* Docker images, and uninstalls OpenShift and # Atomic Enterprise RPMs. It is primarily intended for use # with the tutorial as well as for developers to reset state. +# +--- +- include: uninstall.yml - hosts: - OSEv3:children @@ -8,59 +11,6 @@ sudo: yes tasks: - - service: name={{ item }} state=stopped - with_items: - - openvswitch - - origin-master - - origin-node - - atomic-openshift-master - - atomic-openshift-node - - openshift-master - - openshift-node - - atomic-enterprise-master - - atomic-enterprise-node - - etcd - - - yum: name={{ item }} state=absent - with_items: - - openvswitch - - etcd - - origin - - origin-master - - origin-node - - origin-sdn-ovs - - tuned-profiles-origin-node - - atomic-openshift - - atomic-openshift-master - - atomic-openshift-node - - atomic-openshift-sdn-ovs - - tuned-profiles-atomic-openshift-node - - atomic-enterprise - - atomic-enterprise-master - - atomic-enterprise-node - - atomic-enterprise-sdn-ovs - - tuned-profiles-atomic-enterprise-node - - openshift - - openshift-master - - openshift-node - - openshift-sdn-ovs - - tuned-profiles-openshift-node - - - shell: systemctl reset-failed - changed_when: False - - - shell: systemctl daemon-reload - changed_when: False - - - shell: find /var/lib/origin/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true - changed_when: False - - - shell: find /var/lib/atomic-enterprise/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true - changed_when: False - - - shell: find /var/lib/openshift/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true - changed_when: False - - shell: docker ps -a -q | xargs docker stop changed_when: False failed_when: False @@ -73,27 +23,6 @@ changed_when: False failed_when: False - - file: path={{ item }} state=absent - with_items: - - /etc/openshift-sdn - - /root/.kube - - /etc/origin - - /etc/atomic-enterprise - - /etc/openshift - - /var/lib/origin - - /var/lib/openshift - - /var/lib/atomic-enterprise - - /etc/sysconfig/origin-master - - /etc/sysconfig/origin-node - - /etc/sysconfig/atomic-openshift-master - - /etc/sysconfig/atomic-openshift-node - - /etc/sysconfig/openshift-master - - /etc/sysconfig/openshift-node - - /etc/sysconfig/atomic-enterprise-master - - /etc/sysconfig/atomic-enterprise-node - - /etc/etcd - - /var/lib/etcd - - user: name={{ item }} state=absent remove=yes with_items: - alice -- cgit v1.2.3