Don't fail hard when facter cache doesn't work correctly

Since the facter cache is supposed to be a help but not necessarily a
hard requirement, let's make sure the tasks don't fail if something goes
wrong. We should output the error if the facter execution fails, but we
don't want to always output it.

Change-Id: I58d42c74295f031b260c0b67dbc12336fc31db1f
Related-Bug: #1852606
This commit is contained in:
Alex Schultz 2019-11-14 09:38:34 -07:00
parent 3e25c2c483
commit 79f41d1d41
1 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,13 @@
command: facter --config "{{ tripleo_puppet_cache_base_dir }}/facter.conf"
no_log: true
ignore_errors: true
register: _facter_cache_run
- name: Facter error output when failed
check_mode: false
debug:
msg: "{{ _facter_cache_run.stderr }}"
when: _facter_cache_run is failed
- name: Sync cached facts
become: true
@ -91,3 +98,4 @@
src: "/opt/puppetlabs/"
dest: "{{ tripleo_puppet_cache_base_dir }}/"
delegate_to: "{{ inventory_hostname }}"
when: _facter_cache_run is succeeded