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

(PA-6677) Restore AL2 x86_64 install task and manifest #724

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

joshcooper
Copy link
Contributor

@joshcooper joshcooper commented Jun 22, 2024

Previous commits fixed AL2 aarch64, but broke x86_64.

Added AmazonLinux to metadata.json

After this is merged, install-puppet.sh needs to be regenerated

This should fix https://jenkins-enterprise.delivery.puppetlabs.net/view/pe-integration/view/pe-2021.7.x/job/enterprise_pe-acceptance-tests_integration-system_pe_full-agent-upgrade_nightly_2021.7.x/

@joshcooper joshcooper requested review from bastelfreak and a team as code owners June 22, 2024 00:13
@joshcooper joshcooper force-pushed the amazon-2-aarch64 branch 2 times, most recently from 6633773 to caa51e9 Compare June 22, 2024 01:12
Copy link
Collaborator

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

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

does it make sense to add some unit tests? Also amazonlinux isn't listed in the metadata.json.

@joshcooper joshcooper closed this Jun 24, 2024
@joshcooper joshcooper reopened this Jun 24, 2024
@joshcooper joshcooper force-pushed the amazon-2-aarch64 branch 2 times, most recently from 0e12488 to eddc84a Compare June 24, 2024 20:25
@joshcooper joshcooper force-pushed the amazon-2-aarch64 branch 3 times, most recently from f36f386 to f15d3fb Compare June 24, 2024 23:25
@joshcooper joshcooper changed the title Restore AL2 x86_64 install task and manifest (PA-6677) Restore AL2 x86_64 install task and manifest Jun 24, 2024
The os.release.major fact is defined to be a string[1], so stub it accordingly

[1] https://github.com/puppetlabs/facter/blob/4.7.1/lib/schema/facter.yaml#L1156-L1157
Commit 5c3ffe8 fixed AL2 aarch64, but broke AL2
x86_64.

This commit restores the previous behavior of installing AL2 packages on AL2
aarch64.

It preserves the existing behavior of installing EL6/7 packages on AL1/2 x86_64,
respectively.
Commit bf467db fixed AL2 aarch64, but broke AL2
x86_64 causing the task to install the `puppetN-release-amazon-2.noarch.rpm`
release package, but later the `yum install puppet-agent` command failed,
since there are no AL2 x86_64 builds.

It also broke future releases of amazon, so the hypothetical AL 2025 would
fallback to el-2025.

This commit results on the following mapping:

AL2 x86_64     -> puppetN-release-el-7.noarch.rpm
AL2 aarch64    -> puppetN-release-amazon-2.noarch.rpm
AL2023 (all)   -> puppetN-release-amazon-2023.noarch.rpm

And ensures future AL releases work as expected.
This module does not list OS versions in its supported metadata, so just
add "AmazonLinux" as a supported OS. The name was taken from
puppetlabs-stdlib, instead of Amazon or AL.
@mhashizume mhashizume merged commit 75d15a6 into main Jun 27, 2024
17 checks passed
@mhashizume mhashizume deleted the amazon-2-aarch64 branch June 27, 2024 16:57
# For Amazon Linux 2023 and onwards we can use the 'amazon' packages created instead of 'el' packages
if (( $platform_version == 2023 || $platform_version == 2 )); then
arch="$(uname -p)"
# Install amazon packages on AL2 (only aarch64) and 2003 and up (all arch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but this says 2003 instead of 2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants