Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore failure when yum installing tar in a true airgapped env #146

Merged

Conversation

aceeric
Copy link
Contributor

@aceeric aceeric commented Jun 28, 2023

What type of PR is this?

(REQUIRED)

  • bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

It's debatable whether this is a bug, cleanup, or feature. The rke2_common role tarball_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 task yum 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...

- name: TARBALL | Install tar package
  package:
    name: tar
    state: present

...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

@aceeric aceeric mentioned this pull request Jul 10, 2023
Copy link
Contributor

@adamacosta adamacosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is fine. Lint failure is pre-existing with specifying ignore_errors anywhere. If we care about that, at some point someone needs to go in and define accepted error conditions.

@adamacosta adamacosta merged commit 6c81bed into rancherfederal:main Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants