Installing specific Python version with Puppet

Problem:
Installed puppet/Python from the forge.
Unable to install a specific Python3 version using the name-epoch:ver-rel.arch as the version parameter.
repoquery shows me that the repo contains the 3.7.4 x86_64 version I’m looking for.

repoquery --show-duplicates python3

python3-0:3.7.4-1.amzn2.0.3.i686
python3-0:3.7.4-1.amzn2.0.3.x86_64
python3-0:3.7.4-1.amzn2.0.4.i686
python3-0:3.7.4-1.amzn2.0.4.x86_64
python3-0:3.7.6-1.amzn2.0.1.i686
python3-0:3.7.6-1.amzn2.0.1.x86_64

And executing “yum install python3-0:3.7.4-1.amzn2.0.4.x86_64” directly on the endpoint correctly installs the version i want, so i know yum is capable of doing this and is happy with the version i require.

But when passing “3-0:3.7.4-1.amzn2.0.4.x86_64” into the version param of the python class via Foreman it only ever chooses to install the latest version. Debugging the puppet agent shows that its only ever executing yum install python3, as so just install the latest.

It appears to be just ignoring or not handling anything after the name-epoch: bit of the version string.

Expected outcome:
Installs the version as instructed by the version string.

Foreman and Proxy versions:
Foreman & Proxy : 1.24.2
Clean install recently using the quickstart guide.

Foreman and Proxy plugin versions:

Distribution and version:
Foreman/Puppet Server : Ubuntu 18.04
Puppet Agent : Amazon Linux 2

Other relevant data:

It would be useful to see the exact code you’re using. It also sounds like a Puppet specific issue that doesn’t really have anything to do with Foreman so it may be useful to reach out to that community as well.

The python module on the server was installed using the following

puppet module install puppet-python --version 4.0.0

Other than that everything else has been just completed using the Foreman web gui. I’m brand new to Foreman and Puppet so have no idea where it stores any of the underlying code you speak of.

ok, so after some digging it turns out that the issue is the module puppet-python doesn’t support passthough of the versioning strings in the parameters. it uses regex patterns to only look for specific things and filters everything else out.

So ill be probably customizing this plugin to suit our environment.