summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/adhoc')
-rw-r--r--playbooks/adhoc/bootstrap-fedora.yml1
-rw-r--r--playbooks/adhoc/metrics_setup/playbooks/install.yml9
-rw-r--r--playbooks/adhoc/uninstall.yml48
3 files changed, 41 insertions, 17 deletions
diff --git a/playbooks/adhoc/bootstrap-fedora.yml b/playbooks/adhoc/bootstrap-fedora.yml
index 5ca383a37..b370d7fba 100644
--- a/playbooks/adhoc/bootstrap-fedora.yml
+++ b/playbooks/adhoc/bootstrap-fedora.yml
@@ -1,4 +1,5 @@
- hosts: OSEv3
+ gather_facts: false
tasks:
- name: install python and deps for ansible modules
raw: dnf install -y python2 python2-dnf libselinux-python libsemanage-python python2-firewall pyOpenSSL python-cryptography
diff --git a/playbooks/adhoc/metrics_setup/playbooks/install.yml b/playbooks/adhoc/metrics_setup/playbooks/install.yml
index 235f775ef..a9ec3c1ef 100644
--- a/playbooks/adhoc/metrics_setup/playbooks/install.yml
+++ b/playbooks/adhoc/metrics_setup/playbooks/install.yml
@@ -16,21 +16,30 @@
- name: "Add metrics-deployer"
command: "{{item}}"
+ run_once: true
+ register: output
+ failed_when: ('already exists' not in output.stderr) and (output.rc != 0)
with_items:
- oc project openshift-infra
- oc create -f /tmp/metrics-deployer-setup.yaml
- name: "Give metrics-deployer SA permissions"
command: "oadm policy add-role-to-user edit system:serviceaccount:openshift-infra:metrics-deployer"
+ run_once: true
- name: "Give heapster SA permissions"
command: "oadm policy add-cluster-role-to-user cluster-reader system:serviceaccount:openshift-infra:heapster"
+ run_once: true
- name: "Create metrics-deployer secret"
command: "oc secrets new metrics-deployer nothing=/dev/null"
+ register: output
+ failed_when: ('already exists' not in output.stderr) and (output.rc != 0)
+ run_once: true
- name: "Copy metrics.yaml to remote"
copy: "src=../files/metrics.yaml dest=/tmp/metrics.yaml force=yes"
- name: "Process yml template"
shell: "oc process -f /tmp/metrics.yaml -v MASTER_URL={{ masterPublicURL }},REDEPLOY=true,HAWKULAR_METRICS_HOSTNAME={{ metrics_external_service }},IMAGE_PREFIX={{ metrics_image_prefix }},IMAGE_VERSION={{ metrics_image_version }},USE_PERSISTENT_STORAGE=false | oc create -f -"
+ run_once: true \ No newline at end of file
diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml
index 4edd44fe4..cd569937c 100644
--- a/playbooks/adhoc/uninstall.yml
+++ b/playbooks/adhoc/uninstall.yml
@@ -72,6 +72,10 @@
- tuned-profiles-openshift-node
- tuned-profiles-origin-node
+ - name: Remove flannel package
+ action: "{{ ansible_pkg_mgr }} name=flannel state=absent"
+ when: openshift_use_flannel | default(false) | bool and not is_atomic | bool
+
- shell: systemctl reset-failed
changed_when: False
@@ -92,12 +96,6 @@
- vlinuxbr
- vovsbr
- - name: restart docker
- service: name=docker state=restarted
-
- - name: restart NetworkManager
- service: name=NetworkManager state=restarted
-
- shell: find /var/lib/origin/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true
changed_when: False
@@ -161,31 +159,39 @@
with_items:
- /etc/ansible/facts.d/openshift.fact
- /etc/atomic-enterprise
+ - /etc/dnsmasq.d/origin-dns.conf
+ - /etc/dnsmasq.d/origin-upstream-dns.conf
+ - /etc/NetworkManager/dispatcher.d/99-origin-dns.sh
- /etc/openshift
- /etc/openshift-sdn
- /etc/origin
- - /etc/systemd/system/atomic-openshift-node.service
- - /etc/systemd/system/atomic-openshift-node-dep.service
- - /etc/systemd/system/origin-node.service
- - /etc/systemd/system/origin-node-dep.service
- - /etc/systemd/system/openvswitch.service
- /etc/sysconfig/atomic-enterprise-node
- /etc/sysconfig/atomic-openshift-node
- /etc/sysconfig/atomic-openshift-node-dep
- - /etc/sysconfig/origin-node
- - /etc/sysconfig/origin-node-dep
- /etc/sysconfig/openshift-node
- /etc/sysconfig/openshift-node-dep
- /etc/sysconfig/openvswitch
- /etc/sysconfig/origin-node
+ - /etc/sysconfig/origin-node
+ - /etc/sysconfig/origin-node-dep
+ - /etc/systemd/system/atomic-openshift-node-dep.service
+ - /etc/systemd/system/atomic-openshift-node.service
- /etc/systemd/system/atomic-openshift-node.service.wants
+ - /etc/systemd/system/docker.service.d/docker-sdn-ovs.conf
+ - /etc/systemd/system/openvswitch.service
+ - /etc/systemd/system/origin-node-dep.service
+ - /etc/systemd/system/origin-node.service
- /run/openshift-sdn
- /var/lib/atomic-enterprise
- /var/lib/openshift
- /var/lib/origin
- - /etc/NetworkManager/dispatcher.d/99-origin-dns.sh
- - /etc/dnsmasq.d/origin-dns.conf
- - /etc/dnsmasq.d/origin-upstream-dns.conf
+
+ - name: restart docker
+ service: name=docker state=restarted
+
+ - name: restart NetworkManager
+ service: name=NetworkManager state=restarted
+
- hosts: masters
become: yes
@@ -289,6 +295,7 @@
- /usr/local/bin/oadm
- /usr/local/bin/oc
- /usr/local/bin/kubectl
+ - /etc/flannel
# Since we are potentially removing the systemd unit files for separated
# master-api and master-controllers services, so we need to reload the
@@ -338,7 +345,14 @@
- /etc/ansible/facts.d/openshift.fact
- /etc/etcd
- /etc/systemd/system/etcd_container.service
- - /var/lib/etcd
+
+ # Intenationally using rm command over file module because if someone had mounted a filesystem
+ # at /var/lib/etcd then the contents was not removed correctly
+ - name: Remove etcd data
+ shell: rm -rf /var/lib/etcd/*
+ args:
+ warn: no
+ failed_when: false
- hosts: lb
become: yes