summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-09-12 15:50:32 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-09-29 10:25:58 -0300
commit9dcc8fc7123e1f13e945a658ffe7331730b0105f (patch)
tree3bd75059ff30727706a82c43ac6378a34a03e114 /playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
parent6f056fd9673428c00b5e496a9a084cf09ad777cf (diff)
downloadopenshift-9dcc8fc7123e1f13e945a658ffe7331730b0105f.tar.gz
openshift-9dcc8fc7123e1f13e945a658ffe7331730b0105f.tar.bz2
openshift-9dcc8fc7123e1f13e945a658ffe7331730b0105f.tar.xz
openshift-9dcc8fc7123e1f13e945a658ffe7331730b0105f.zip
Split upgrade for control plane/nodes.
Diffstat (limited to 'playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml')
-rw-r--r--playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml60
1 files changed, 60 insertions, 0 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
new file mode 100644
index 000000000..0ab8ba23c
--- /dev/null
+++ b/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
@@ -0,0 +1,60 @@
+---
+- name: Evacuate and upgrade nodes
+ hosts: oo_nodes_to_config
+ serial: 1
+ any_errors_fatal: true
+ roles:
+ - openshift_facts
+ handlers:
+ - include: ../../../../roles/openshift_node/handlers/main.yml
+ static: yes
+ tasks:
+ # TODO: To better handle re-trying failed upgrades, it would be nice to check if the node
+ # or docker actually needs an upgrade before proceeding. Perhaps best to save this until
+ # we merge upgrade functionality into the base roles and a normal config.yml playbook run.
+ - name: Determine if node is currently scheduleable
+ command: >
+ {{ openshift.common.client_binary }} get node {{ openshift.node.nodename | lower }} -o json
+ register: node_output
+ delegate_to: "{{ groups.oo_first_master.0 }}"
+ changed_when: false
+ when: inventory_hostname in groups.oo_nodes_to_config
+
+ - set_fact:
+ was_schedulable: "{{ 'unschedulable' not in (node_output.stdout | from_json).spec }}"
+ when: inventory_hostname in groups.oo_nodes_to_config
+
+ - name: Mark unschedulable if host is a node
+ command: >
+ {{ openshift.common.admin_binary }} manage-node {{ openshift.node.nodename | lower }} --schedulable=false
+ delegate_to: "{{ groups.oo_first_master.0 }}"
+ when: inventory_hostname in groups.oo_nodes_to_config
+
+ - name: Evacuate Node for Kubelet upgrade
+ command: >
+ {{ openshift.common.admin_binary }} manage-node {{ openshift.node.nodename | lower }} --evacuate --force
+ delegate_to: "{{ groups.oo_first_master.0 }}"
+ when: inventory_hostname in groups.oo_nodes_to_config
+
+ - include: docker/upgrade.yml
+ when: l_docker_upgrade is defined and l_docker_upgrade | bool and not openshift.common.is_atomic | bool
+
+ - include: "{{ node_config_hook }}"
+ when: node_config_hook is defined and inventory_hostname in groups.oo_nodes_to_config
+
+ - include: rpm_upgrade.yml
+ vars:
+ component: "node"
+ openshift_version: "{{ openshift_pkg_version | default('') }}"
+ when: inventory_hostname in groups.oo_nodes_to_config and not openshift.common.is_containerized | bool
+
+ - include: containerized_node_upgrade.yml
+ when: inventory_hostname in groups.oo_nodes_to_config and openshift.common.is_containerized | bool
+
+ - meta: flush_handlers
+
+ - name: Set node schedulability
+ command: >
+ {{ openshift.common.admin_binary }} manage-node {{ openshift.node.nodename | lower }} --schedulable=true
+ delegate_to: "{{ groups.oo_first_master.0 }}"
+ when: inventory_hostname in groups.oo_nodes_to_config and was_schedulable | bool