Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6816 from jtudelag/pre-post-node-hook
Browse files Browse the repository at this point in the history
Adds node hooks: pre, mid and post update hook.
  • Loading branch information
sdodson committed Apr 2, 2018
2 parents b209baa + 54beb36 commit 74e1fb8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,36 @@
- l_upgrade_nodes_drain_result is failed
- openshift_upgrade_nodes_drain_timeout | default(0) | int == 0

# Run the pre-upgrade hook if defined:
- debug: msg="Running node pre-upgrade hook {{ openshift_node_upgrade_pre_hook }}"
when: openshift_node_upgrade_pre_hook is defined

- include_tasks: "{{ openshift_node_upgrade_pre_hook }}"
when: openshift_node_upgrade_pre_hook is defined

post_tasks:
- import_role:
name: openshift_node
tasks_from: upgrade.yml

# Run the upgrade hook prior to make the node schedulable again.
- debug: msg="Running node upgrade hook {{ openshift_node_upgrade_hook }}"
when: openshift_node_upgrade_hook is defined

- include_tasks: "{{ openshift_node_upgrade_hook }}"
when: openshift_node_upgrade_hook is defined

- 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 is succeeded
when: node_unschedulable is changed

- import_role:
name: openshift_manage_node
tasks_from: config.yml
Expand All @@ -63,3 +89,10 @@
name: openshift_excluder
vars:
r_openshift_excluder_action: enable

# Run the post-upgrade hook if defined:
- debug: msg="Running node post-upgrade hook {{ openshift_node_upgrade_post_hook }}"
when: openshift_node_upgrade_post_hook is defined

- include_tasks: "{{ openshift_node_upgrade_post_hook }}"
when: openshift_node_upgrade_post_hook is defined

0 comments on commit 74e1fb8

Please sign in to comment.