puppetlabs-puppet_agent icon indicating copy to clipboard operation
puppetlabs-puppet_agent copied to clipboard

add support for Amazon Linux 2023 agent in PE environment

Open vchepkov opened this issue 1 year ago • 8 comments

With latest PE adding support for Amazon Linux 2023 agents, could you, please, add support to the module?

vchepkov avatar May 09 '24 13:05 vchepkov

Maybe this is the only place where it needs to be fixed? it should have amazon prefix here

https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/main/manifests/osfamily/redhat.pp#L41-L42

vchepkov avatar May 09 '24 14:05 vchepkov

Also, for PE installation this description is incorrect https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/main/manifests/osfamily/redhat.pp#L161

vchepkov avatar May 09 '24 14:05 vchepkov

I think this was done already https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/692? What behavior are you expecting? What is the actual behavior?

joshcooper avatar May 09 '24 15:05 joshcooper

@joshcooper , I posted comments above PE repo starts with 'amazon' whereas module creates 'el-' prefix

vchepkov avatar May 09 '24 16:05 vchepkov

@vchepkov you're describing the solution, not the problem. Can you provide steps to reproduce the problem and what behavior you're expecting?

Also /cc @span786

joshcooper avatar May 09 '24 17:05 joshcooper

@joshcooper , I might not understand your question, I apologize Module generates repo file with the following content:

# head /etc/yum.repos.d/pc_repo.repo 
[pc_repo]
name=Puppet Labs puppet7 Repository
baseurl=https://puppet.example.com:8140/packages/2021.7.8/el-2023-x86_64

Since baseurl is incorrect, dnf fails:

 (/Stage[main]/Puppet_agent::Install/Package[puppet-agent]/ensure) change from '7.28.0-1.amazon2023' to '7.30.0' failed: Could not update: Execution of '/bin/yum -d 0 -e 0 -y update puppet-agent-7.30.0' returned 1:

vchepkov avatar May 09 '24 17:05 vchepkov

@vchepkov ah thanks that makes sense. It looks like https://github.com/puppetlabs/puppetlabs-puppet_agent/commit/d5ad1568fec330c3196c97d209e3f61ee1c2dd29 fixed one place but not the other:

      # Treat Amazon Linux just like Enterprise Linux
      $pe_repo_dir = ($facts['os']['name'] == 'Amazon') ? {
        true    => "el-${amz_el_version}-${facts['os']['architecture']}",
        default => $facts['platform_tag'],
      }

@span786 can you take a look?

joshcooper avatar May 09 '24 18:05 joshcooper

@joshcooper , @span786, considering that Amazon 2 march also was released, presumably that platform also needs to be fixed

vchepkov avatar Jun 21 '24 14:06 vchepkov

@vchepkov I made some updates to this module for Amazon support in 75d15a6, but it hasn't been released yet. And we've begun shipping Amazon 2023 specific packages for both architectures, see https://yum.puppet.com/puppet8/amazon/2023 Could you provide a sample manifest to reproduce the problem you're seeing so that we can verify if more work is needed?

FWIW, the module should map the baseurl as follows for different combinations of Amazon OS versions and architectures:

https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/4680ee413e0cecdaf76123a5c5760aac4bc10933/spec/classes/puppet_agent_osfamily_redhat_spec.rb#L31-L36

joshcooper avatar Sep 24 '24 15:09 joshcooper

Just include puppet_agent on AL nodes managed by PE, nothing special. I will test against HEAD and report back

vchepkov avatar Sep 24 '24 18:09 vchepkov

@joshcooper , I tested on 4 ec2 instances al2/al2023/x86_64/aarch64 - all updated clients to 8.8.1

Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]/ensure: ensure changed '7.32.1-1.amazon2023' to '8.8.1'
Notice: Stopping run after puppet-agent upgrade. Run puppet agent -t or apply your manifest again to finish the transaction.
Notice: Applied catalog in 16.42 seconds
Ignoring ffi-1.16.3 because its extensions are not built. Try: gem pristine ffi --version 1.16.3

Beside that weird message at the end, everything seems to be fine, thank you

vchepkov avatar Sep 24 '24 19:09 vchepkov

Thanks @vchepkov!! Do you get that message everytime the agent runs? Or just on upgrade?

joshcooper avatar Sep 24 '24 20:09 joshcooper

Only on upgrades from puppet 7 to puppet 8

vchepkov avatar Sep 24 '24 20:09 vchepkov

Thanks @vchepkov we'll get a release out

joshcooper avatar Sep 25 '24 00:09 joshcooper

Fixed in 610b6da571c75d1f5ca50fe29cff7a8014253dae

joshcooper avatar Sep 25 '24 00:09 joshcooper