summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-05-03 11:28:30 -0400
committerRussell Teague <rteague@redhat.com>2017-05-03 13:37:14 -0400
commit5c8450e53fcb216cd22f74150d53a73e17bef5a0 (patch)
tree3cbcd4e03e7e806548475886acc53edb3b7ee213
parent468531c30eaf967bb57e9ce23da5796c997f9a14 (diff)
downloadopenshift-5c8450e53fcb216cd22f74150d53a73e17bef5a0.tar.gz
openshift-5c8450e53fcb216cd22f74150d53a73e17bef5a0.tar.bz2
openshift-5c8450e53fcb216cd22f74150d53a73e17bef5a0.tar.xz
openshift-5c8450e53fcb216cd22f74150d53a73e17bef5a0.zip
Ensure repo cache is clean on the first run
The openshift_repos role is modified to clean the repo cache on first run to ensure a clean cache in the situation where the repo files have been changed manually, such as just prior to upgrades.
-rw-r--r--playbooks/common/openshift-cluster/upgrades/init.yml11
-rw-r--r--roles/openshift_repos/tasks/main.yaml17
2 files changed, 17 insertions, 11 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/init.yml b/playbooks/common/openshift-cluster/upgrades/init.yml
index cbf6d58b3..0f421928b 100644
--- a/playbooks/common/openshift-cluster/upgrades/init.yml
+++ b/playbooks/common/openshift-cluster/upgrades/init.yml
@@ -10,17 +10,6 @@
- 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
-
- name: Ensure firewall is not switched during upgrade
hosts: oo_all_hosts
tasks:
diff --git a/roles/openshift_repos/tasks/main.yaml b/roles/openshift_repos/tasks/main.yaml
index 84a0905cc..9a9436fcb 100644
--- a/roles/openshift_repos/tasks/main.yaml
+++ b/roles/openshift_repos/tasks/main.yaml
@@ -40,4 +40,21 @@
- openshift_deployment_type == 'origin'
- openshift_enable_origin_repo | default(true) | bool
+ # Singleton block
+ - when: r_osr_first_run | default(true)
+ block:
+ - name: Ensure clean repo cache in the event repos have been changed manually
+ debug:
+ msg: "First run of openshift_repos"
+ changed_when: true
+ notify: refresh cache
+
+ - name: Set fact r_osr_first_run false
+ set_fact:
+ r_osr_first_run: false
+
+ # Force running ALL handlers now, because we expect repo cache to be cleared
+ # if changes have been made.
+ - meta: flush_handlers
+
when: not ostree_booted.stat.exists