Ignore failure when yum installing tar in a true airgapped env #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
It's debatable whether this is a bug, cleanup, or feature. The
rke2_common
roletarball_install
task is only invoked when the binaries are staged. This is our scenario for a fully air-gapped install. In a true air-gapped install, a yum repository server is not accessible. Yet the taskyum installs tar
. Unfortunately this initiates the yum metadata / caching functionality. Of course this can all be configured / overridden / etc. But - what we're encountering is this statement......fails because there's no network-accessible yum repository server to sync metadata from. This PR simply ignores the error because the very next statement invokes the tar command which - if tar isn't already installed and the yum install tar fails - the task still fails: the net effect is identical So the addition from this PR prevents the playbook from failing in a fully disconnected environment without a lot of yum configuration, and supports the intent of the original mod to add tar if it's missing, and fails if there is any actual issue with tar just like before the PR.
Which issue(s) this PR fixes:
I did not submit an issue.
Special notes for your reviewer:
Testing
Tested in an airgapped environment with tar already installed.
Release Notes
This should not affect users. If tar isn't installed, and can't be installed, the playbook fails before and after the PR. If tar is already installed, the playbook succeeds before and after the PR even in an air-gapped environment