From 5c8450e53fcb216cd22f74150d53a73e17bef5a0 Mon Sep 17 00:00:00 2001 From: Russell Teague Date: Wed, 3 May 2017 11:28:30 -0400 Subject: 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. --- roles/openshift_repos/tasks/main.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'roles/openshift_repos/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 -- cgit v1.2.3