summaryrefslogtreecommitdiffstats
path: root/playbooks/byo/openshift-cluster/upgrades
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-04-07 16:16:14 -0400
committerRussell Teague <rteague@redhat.com>2017-04-10 09:39:51 -0400
commitb4c2a7507ced4c47732a20b819d2e34bf4ca129c (patch)
tree8df0c047c996303af179ea3b2d04dac0ea210c08 /playbooks/byo/openshift-cluster/upgrades
parent3ea629b458c78db194443563aab4a8d09e9a07b4 (diff)
downloadopenshift-b4c2a7507ced4c47732a20b819d2e34bf4ca129c.tar.gz
openshift-b4c2a7507ced4c47732a20b819d2e34bf4ca129c.tar.bz2
openshift-b4c2a7507ced4c47732a20b819d2e34bf4ca129c.tar.xz
openshift-b4c2a7507ced4c47732a20b819d2e34bf4ca129c.zip
Refactor docker upgrade playbooks
The playbooks were crossing byo/common boundaries for task includes. This moves all 'common' files/tasks into the 'common' folder.
Diffstat (limited to 'playbooks/byo/openshift-cluster/upgrades')
-rw-r--r--playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml62
l---------playbooks/byo/openshift-cluster/upgrades/docker/nuke_images.sh1
l---------playbooks/byo/openshift-cluster/upgrades/docker/roles1
-rw-r--r--playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml11
4 files changed, 1 insertions, 74 deletions
diff --git a/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml
deleted file mode 100644
index 304559f6e..000000000
--- a/playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml
+++ /dev/null
@@ -1,62 +0,0 @@
----
-- name: Check for appropriate Docker versions
- hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
- roles:
- - openshift_facts
- tasks:
- - set_fact:
- repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"
-
- - fail:
- msg: Cannot upgrade Docker on Atomic operating systems.
- when: openshift.common.is_atomic | bool
-
- - include: ../../../../common/openshift-cluster/upgrades/docker/upgrade_check.yml
- when: docker_upgrade is not defined or docker_upgrade | bool
-
-
-# If a node fails, halt everything, the admin will need to clean up and we
-# don't want to carry on, potentially taking out every node. The playbook can safely be re-run
-# and will not take any action on a node already running the requested docker version.
-- name: Drain and upgrade nodes
- hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
- serial: 1
- any_errors_fatal: true
-
- roles:
- - lib_openshift
-
- tasks:
- - name: Mark node unschedulable
- oc_adm_manage_node:
- node: "{{ openshift.node.nodename | lower }}"
- schedulable: False
- delegate_to: "{{ groups.oo_first_master.0 }}"
- retries: 10
- delay: 5
- register: node_unschedulable
- until: node_unschedulable|succeeded
- when:
- - l_docker_upgrade is defined
- - l_docker_upgrade | bool
- - inventory_hostname in groups.oo_nodes_to_upgrade
-
- - name: Drain Node for Kubelet upgrade
- command: >
- {{ openshift.common.admin_binary }} drain {{ openshift.node.nodename }} --force --delete-local-data --ignore-daemonsets
- delegate_to: "{{ groups.oo_first_master.0 }}"
- when: l_docker_upgrade is defined and l_docker_upgrade | bool and inventory_hostname in groups.oo_nodes_to_upgrade
-
- - include: ../../../../common/openshift-cluster/upgrades/docker/upgrade.yml
- when: l_docker_upgrade is defined and l_docker_upgrade | bool
-
- - name: Set node schedulability
- oc_adm_manage_node:
- node: "{{ openshift.node.nodename | lower }}"
- schedulable: True
- delegate_to: "{{ groups.oo_first_master.0 }}"
- retries: 10
- delay: 5
- register: node_schedulable
- until: node_schedulable|succeeded
- when: node_unschedulable|changed
diff --git a/playbooks/byo/openshift-cluster/upgrades/docker/nuke_images.sh b/playbooks/byo/openshift-cluster/upgrades/docker/nuke_images.sh
deleted file mode 120000
index d5d864b63..000000000
--- a/playbooks/byo/openshift-cluster/upgrades/docker/nuke_images.sh
+++ /dev/null
@@ -1 +0,0 @@
-../../../../common/openshift-cluster/upgrades/files/nuke_images.sh \ No newline at end of file
diff --git a/playbooks/byo/openshift-cluster/upgrades/docker/roles b/playbooks/byo/openshift-cluster/upgrades/docker/roles
deleted file mode 120000
index 6bc1a7aef..000000000
--- a/playbooks/byo/openshift-cluster/upgrades/docker/roles
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../roles \ No newline at end of file
diff --git a/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
index 5feb33be4..5c1c29395 100644
--- a/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
+++ b/playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
@@ -24,13 +24,4 @@
tasks:
- include_vars: ../../cluster_hosts.yml
-- include: ../../../../common/openshift-cluster/evaluate_groups.yml
- vars:
- # Do not allow adding hosts during upgrade.
- g_new_master_hosts: []
- g_new_node_hosts: []
- openshift_cluster_id: "{{ cluster_id | default('default') }}"
-
-- include: ../../../../common/openshift-cluster/upgrades/initialize_nodes_to_upgrade.yml
-
-- include: docker_upgrade.yml
+- include: ../../../../common/openshift-cluster/upgrades/docker/docker_upgrade.yml