From c0267e0c35ffd05ea166886608db66e430a2f725 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Wed, 3 Jun 2020 07:44:17 -0600 Subject: [PATCH] Improve facter cache reliability We don't need to be caching EC2 metadata in our facter runs because we don't use this. By leaving this on, it can cause problems when run on VMs in a cloud that might support EC2. By having this enabled, we can see deployments failing to configure nodes because it timesout: 2020-05-13 22:38:30.574339 ERROR puppetlabs.facter - EC2 user data request failed: Timeout was reached Additionally if facter fails to generate the cache, the subsequent puppet runs will fail. This change also added retries to the facter cache call to ensure that we should be able to generate the cache if an external fact call fails for some reason. NOTE: The master patch for this is against tripleo-ansible Closes-Bug: #1861917 Change-Id: Iaaed0dcf747ca4a08f8e200b43d0f2259ad0ed39 (cherry-picked from c3b57d6a6c26acf35168fea7303fc485e1dcd13f) --- common/deploy-steps-tasks.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/deploy-steps-tasks.yaml b/common/deploy-steps-tasks.yaml index f18ee1a885..84457c4e1d 100644 --- a/common/deploy-steps-tasks.yaml +++ b/common/deploy-steps-tasks.yaml @@ -335,6 +335,7 @@ dest: /var/lib/container-puppet/puppetlabs/facter.conf content: | facts : { + blocklist: [ "EC2" ], ttls: [ { "kernel" : 8 hour }, { "memory" : 8 hour }, @@ -353,12 +354,14 @@ - name: Pre-cache facts check_mode: false command: facter --config /var/lib/container-puppet/puppetlabs/facter.conf + retries: 5 + delay: 5 no_log: True ignore_errors: True register: _facter_cache_run - - name: Facter error output when failed + - name: Failed deployment if facter fails check_mode: false - debug: + fail: msg: "{{ _facter_cache_run.stderr }}" when: _facter_cache_run is failed - name: Sync cached facts