From e8e9965eb75597f113833df414976d6cce8d2324 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Fri, 22 Nov 2019 14:08:56 -0700 Subject: [PATCH] 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 (cherry picked from 79f41d1d41a23b8b851410a912fd352c5e6fac32) --- common/deploy-steps-tasks.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/deploy-steps-tasks.yaml b/common/deploy-steps-tasks.yaml index 364b4e6525..e6a39c93d7 100644 --- a/common/deploy-steps-tasks.yaml +++ b/common/deploy-steps-tasks.yaml @@ -167,14 +167,23 @@ state: absent ignore_errors: True - name: Pre-cache facts + check_mode: false command: facter --config /var/lib/container-puppet/puppetlabs/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 + check_mode: false synchronize: src: /opt/puppetlabs/ dest: /var/lib/container-puppet/puppetlabs/ delegate_to: "{{ inventory_hostname }}" + when: _facter_cache_run is succeeded ###################################### # Generate config via container-puppet.py