summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2017-01-20 16:05:24 -0400
committerDevan Goodwin <dgoodwin@redhat.com>2017-01-23 11:47:45 -0400
commit50ce715a704f77190a278bed2326cc567855181d (patch)
tree3ec2a583df16f9a4955769fd41059835f9429eda
parente2754beb950f69294b71253b9f732b11c2a234f5 (diff)
downloadopenshift-50ce715a704f77190a278bed2326cc567855181d.tar.gz
openshift-50ce715a704f77190a278bed2326cc567855181d.tar.bz2
openshift-50ce715a704f77190a278bed2326cc567855181d.tar.xz
openshift-50ce715a704f77190a278bed2326cc567855181d.zip
Add a mid upgrade hook, re-prefix variables.
-rw-r--r--inventory/byo/hosts.origin.example12
-rw-r--r--inventory/byo/hosts.ose.example12
-rw-r--r--playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml26
3 files changed, 33 insertions, 17 deletions
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index 062a776b0..0a1b8c5c4 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -97,11 +97,15 @@ openshift_release=v1.4
# absolute paths, if not the path will be treated as relative to the file where the
# hook is actually used.
#
-# Tasks to run before each master is upgraded:
-# openshift_upgrade_pre_master_hook=/usr/share/custom/pre_master.yml
+# Tasks to run before each master is upgraded.
+# openshift_master_upgrade_pre_hook=/usr/share/custom/pre_master.yml
#
-# Tasks to run after each master is upgraded:
-# openshift_upgrade_post_master_hook=/usr/share/custom/post_master.yml
+# Tasks to run to upgrade the master. These tasks run after the main openshift-ansible
+# upgrade steps, but before we restart system/services.
+# openshift_master_upgrade_hook=/usr/share/custom/master.yml
+#
+# Tasks to run after each master is upgraded and system/services have been restarted.
+# openshift_master_upgrade_post_hook=/usr/share/custom/post_master.yml
# Alternate image format string, useful if you've got your own registry mirror
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index bcc2373ce..89b9d7e48 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -97,11 +97,15 @@ openshift_release=v3.4
# absolute paths, if not the path will be treated as relative to the file where the
# hook is actually used.
#
-# Tasks to run before each master is upgraded:
-# openshift_upgrade_pre_master_hook=/usr/share/custom/pre_master.yml
+# Tasks to run before each master is upgraded.
+# openshift_master_upgrade_pre_hook=/usr/share/custom/pre_master.yml
#
-# Tasks to run after each master is upgraded:
-# openshift_upgrade_post_master_hook=/usr/share/custom/post_master.yml
+# Tasks to run to upgrade the master. These tasks run after the main openshift-ansible
+# upgrade steps, but before we restart system/services.
+# openshift_master_upgrade_hook=/usr/share/custom/master.yml
+#
+# Tasks to run after each master is upgraded and system/services have been restarted.
+# openshift_master_upgrade_post_hook=/usr/share/custom/post_master.yml
# Alternate image format string, useful if you've got your own registry mirror
diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
index 9cec6ac4b..77b37cdc2 100644
--- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
+++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
@@ -65,11 +65,12 @@
- openshift_facts
post_tasks:
- - debug: msg="Running pre-master upgrade hook {{ openshift_upgrade_pre_master_hook }}"
- when: openshift_upgrade_pre_master_hook is defined
+ # Run the pre-upgrade hook if defined:
+ - debug: msg="Running master pre-upgrade hook {{ openshift_master_upgrade_pre_hook }}"
+ when: openshift_master_upgrade_pre_hook is defined
- - include: "{{ openshift_upgrade_pre_master_hook }}"
- when: openshift_upgrade_pre_master_hook is defined
+ - include: "{{ openshift_master_upgrade_pre_hook }}"
+ when: openshift_master_upgrade_pre_hook is defined
- include: rpm_upgrade.yml component=master
when: not openshift.common.is_containerized | bool
@@ -111,12 +112,12 @@
state: link
when: ca_crt_stat.stat.isreg and not ca_bundle_stat.stat.exists
- # NOTE: We run user provided hooks prior to restarting the system or services.
- - debug: msg="Running post-master upgrade hook {{ openshift_upgrade_post_master_hook }}"
- when: openshift_upgrade_post_master_hook is defined
+ # Run the upgrade hook prior to restarting services/system if defined:
+ - debug: msg="Running master upgrade hook {{ openshift_master_upgrade_hook }}"
+ when: openshift_master_upgrade_hook is defined
- - include: "{{ openshift_upgrade_post_master_hook }}"
- when: openshift_upgrade_post_master_hook is defined
+ - include: "{{ openshift_master_upgrade_hook }}"
+ when: openshift_master_upgrade_hook is defined
- include: ../../openshift-master/restart_hosts.yml
when: openshift.common.rolling_restart_mode == 'system'
@@ -124,6 +125,13 @@
- include: ../../openshift-master/restart_services.yml
when: openshift.common.rolling_restart_mode == 'services'
+ # Run the post-upgrade hook if defined:
+ - debug: msg="Running master post-upgrade hook {{ openshift_master_upgrade_post_hook }}"
+ when: openshift_master_upgrade_post_hook is defined
+
+ - include: "{{ openshift_master_upgrade_post_hook }}"
+ when: openshift_master_upgrade_post_hook is defined
+
- set_fact:
master_update_complete: True