# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. --- - 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" "{{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 register: test_occ_results until: test_occ_results.rc == 0 retries: 2 delay: 15