From 35fd0a5fa79379211562b869032c2b56f66b4cc6 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Mon, 8 Dec 2014 01:32:27 -0500 Subject: [PATCH] Fix to os-collect-config run logic Rebased previous state to merge in behavior in change I2dd21f115c3425e68fe37e2235ab6a8ff56fa43a coupled with logic fix to prevent un-necessary exectuion of os-collect-config. Corrected the grep command with a simpler search as the more complex search was not returning results. Corrected logic utilizing fact set as part of the grep command as the string was being converted to a boolean value and thus could only be compared as such. Change-Id: I8c88d5b5a20bca5be1dd66495fd708871c6a684e --- playbooks/step_run_occ.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/playbooks/step_run_occ.yml b/playbooks/step_run_occ.yml index 333c775..d8d91ea 100644 --- a/playbooks/step_run_occ.yml +++ b/playbooks/step_run_occ.yml @@ -16,5 +16,16 @@ - name: Remove os-collect-config disable sentinel file file: path=/mnt/state/disable-os-collect-config state=absent sudo: yes +- name: "Setting default fact to run os-collect-config" + set_fact: test_bypass_os_collect_config="False" +- name: "Evaluate if os-collect-config needs to be run" + command: grep -q -i "Completed phase migration" /var/log/upstart/os-collect-config.log + register: test_did_os_collect_config_complete + ignore_errors: yes + when: online_upgrade is not defined +- name: "Setting fact to bypass os-collect-config if applicable" + set_fact: test_bypass_os_collect_config="True" + when: online_upgrade is not defined and test_did_os_collect_config_complete.rc == 0 - name: "Execute os-collect-config" command: os-collect-config --force --one + when: test_bypass_os_collect_config != true