summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster/upgrades
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/common/openshift-cluster/upgrades')
-rw-r--r--playbooks/common/openshift-cluster/upgrades/init.yml17
-rw-r--r--playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml4
-rw-r--r--playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml24
3 files changed, 39 insertions, 6 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/init.yml b/playbooks/common/openshift-cluster/upgrades/init.yml
index 8cac2fb3b..76645ff3f 100644
--- a/playbooks/common/openshift-cluster/upgrades/init.yml
+++ b/playbooks/common/openshift-cluster/upgrades/init.yml
@@ -1,5 +1,6 @@
---
-- hosts: localhost
+- name: Create l_oo_all_hosts group
+ hosts: localhost
connection: local
become: no
gather_facts: no
@@ -10,7 +11,8 @@
groups: l_oo_all_hosts
with_items: "{{ g_all_hosts | default([]) }}"
-- hosts: l_oo_all_hosts
+- name: Include g_*_hosts vars for hosts in group l_oo_all_hosts
+ hosts: l_oo_all_hosts
gather_facts: no
tasks:
- include_vars: ../../../byo/openshift-cluster/cluster_hosts.yml
@@ -46,3 +48,14 @@
when: openshift_docker_log_options is not defined
- include: ../initialize_facts.yml
+
+- name: Ensure clean repo cache in the event repos have been changed manually
+ hosts: oo_all_hosts
+ tags:
+ - pre_upgrade
+ tasks:
+ - name: Clean package cache
+ command: "{{ ansible_pkg_mgr }} clean all"
+ when: not openshift.common.is_atomic | bool
+ args:
+ warn: no
diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml
index 9632626a4..c83923dae 100644
--- a/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml
+++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml
@@ -12,10 +12,6 @@
msg: Verify the correct version was found
when: verify_upgrade_version is defined and openshift_version != verify_upgrade_version
- - name: Clean package cache
- command: "{{ ansible_pkg_mgr }} clean all"
- when: not openshift.common.is_atomic | bool
-
- set_fact:
g_new_service_name: "{{ 'origin' if deployment_type =='origin' else 'atomic-openshift' }}"
when: not openshift.common.is_containerized | bool
diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
index 7f738ea0f..77b37cdc2 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,14 @@
roles:
- openshift_facts
post_tasks:
+
+ # 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_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
@@ -102,12 +112,26 @@
state: link
when: ca_crt_stat.stat.isreg and not ca_bundle_stat.stat.exists
+ # 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_master_upgrade_hook }}"
+ when: openshift_master_upgrade_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'
+ # 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