Closed tbrisker closed 6 years ago
Thanks for the PR!
Can you do a couple things:
satellite_installed
variableThe pre-install check can be skipped completely, which makes things a little complicated, we would be adding the ability to skip something that can already be skipped.
I would be in favor of adding this to the main part of the role in the beginning, after pre-install check, this way it can be skipped independent of the pre-install check.
Then you would need a way to skip, so some default variable such as skip_satellite_rpm_check
and add when: skip_satellite_rpm_check
to the tasks.
Then create a default False value for this variable here and add it to the config file
let me know if you have any questions/concerns!
@tbrisker looks good at a glance, I'll test out manually.
It still would be nice to have an option to skip this check as the cache does clear itself (I think it persists for a week) and this check will be performed again with no way of skipping
@johnpmitsch couldn't the user just set the variable manually if they want to skip it?
@tbrisker I'm thinking we have a 'skip_satellite_rpm_check" variable that defaults to false and can be overwritten in the config. I'm open to other suggestions, the important things are: the user knows what variable to set w/o reading code, and the steps can be skipped if the cache is cleared
updated
yee-haw
Currently failing with
TASK [satellite-clone : Check if satellite is already installed] ***************
Wednesday 29 November 2017 18:25:51 +0000 (0:00:00.014) 0:00:01.372 ****
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["rpm", "-q", "satellite"], "delta": "0:00:00.280178", "end": "2017-11-29 18:25:51.966258", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2017-11-29 18:25:51.686080", "stderr": "", "stderr_lines": [], "stdout": "package satellite is not installed", "stdout_lines": ["package satellite is not installed"]}
cmd: rpm -q satellite
start: 2017-11-29 18:25:51.686080
end: 2017-11-29 18:25:51.966258
delta: 0:00:00.280178
msg: non-zero return code
stdout: package satellite is not installed
You need to ignore this error by adding ignore_errors: yes
or an alternative solution
@johnpmitsch thanks, updated
yee-haw
@tbrisker works great! playbook ran fine the first time and the second time with no modifications, even though satellite was installed. When I deleted the cache, I encountered the proper "satellite is installed" error and needed to add "skip_satellite_rpm_check: false" to the config file as expected.
One small change, can you add this sentence to the satellite is not installed error message?
_If you would like to force a skip of this check, please set skip_satellite_rpm_check
to true in satellite-clone-vars.yml_
@johnpmitsch thanks, updated!
thanks @tbrisker!
currently if there are any errors in playbook, we simply rerun it. But this new step will prevent rerunning of the playbook. Can we have an option to override this check may be?