
Downstream opted to only ever attempt to execute os-collect-config once, however upstream naturally has slight differences that may necessitate more than one os-collect-config run to complete node configuration. This change reinstates the logic to attempt os-collect-config a second time if it fails the first time which was first introduced in I74ff31b52367fc0279ffa43a3724e44a2578ced3. Change-Id: I7470ca3a5b0dffa844008e5550281d98f1b137a6
36 lines
1.5 KiB
YAML
36 lines
1.5 KiB
YAML
# 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
|