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
This commit is contained in:
Julia Kreger 2014-12-08 01:32:27 -05:00 committed by stephane
parent 29067f3a8a
commit 35fd0a5fa7

View File

@ -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