From 2c91510d4ce3baa92e8e054223659e4e3fa5dbcd Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 17 Jan 2017 14:55:46 -0400 Subject: Implement pre/post master upgrade hooks. --- .../common/openshift-cluster/upgrades/upgrade_control_plane.yml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml index 7f738ea0f..59e5010f5 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml @@ -51,6 +51,8 @@ roles: - openshift_master_facts +# The main master upgrade play. Should handle all changes to the system in one pass, with +# support for optional hooks to be defined. - name: Upgrade master hosts: oo_masters_to_config vars: @@ -62,6 +64,10 @@ roles: - openshift_facts post_tasks: + + - include: "{{ openshift_upgrade_pre_master_hook }}" + when: openshift_upgrade_pre_master_hook is defined + - include: rpm_upgrade.yml component=master when: not openshift.common.is_containerized | bool @@ -108,6 +114,9 @@ - include: ../../openshift-master/restart_services.yml when: openshift.common.rolling_restart_mode == 'services' + - include: "{{ openshift_upgrade_post_master_hook }}" + when: openshift_upgrade_post_master_hook is defined + - set_fact: master_update_complete: True -- cgit v1.2.3 From 67972f33b0f380ae0ddf888389c0419ffa17c7a8 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 17 Jan 2017 15:50:30 -0400 Subject: Run user provided hooks prior to system/service restarts. --- .../common/openshift-cluster/upgrades/upgrade_control_plane.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml index 59e5010f5..538d0942f 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml @@ -108,15 +108,16 @@ 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. + - include: "{{ openshift_upgrade_post_master_hook }}" + when: openshift_upgrade_post_master_hook is defined + - include: ../../openshift-master/restart_hosts.yml when: openshift.common.rolling_restart_mode == 'system' - include: ../../openshift-master/restart_services.yml when: openshift.common.rolling_restart_mode == 'services' - - include: "{{ openshift_upgrade_post_master_hook }}" - when: openshift_upgrade_post_master_hook is defined - - set_fact: master_update_complete: True -- cgit v1.2.3 From e2754beb950f69294b71253b9f732b11c2a234f5 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Thu, 19 Jan 2017 14:44:20 -0400 Subject: Debug message before running hooks. --- .../common/openshift-cluster/upgrades/upgrade_control_plane.yml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'playbooks/common') diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml index 538d0942f..9cec6ac4b 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml @@ -65,6 +65,9 @@ - openshift_facts post_tasks: + - debug: msg="Running pre-master upgrade hook {{ openshift_upgrade_pre_master_hook }}" + when: openshift_upgrade_pre_master_hook is defined + - include: "{{ openshift_upgrade_pre_master_hook }}" when: openshift_upgrade_pre_master_hook is defined @@ -109,6 +112,9 @@ 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 + - include: "{{ openshift_upgrade_post_master_hook }}" when: openshift_upgrade_post_master_hook is defined -- cgit v1.2.3 From 50ce715a704f77190a278bed2326cc567855181d Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Fri, 20 Jan 2017 16:05:24 -0400 Subject: Add a mid upgrade hook, re-prefix variables. --- .../upgrades/upgrade_control_plane.yml | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'playbooks/common') 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 -- cgit v1.2.3