Skip to content

Commit 78e08fa

Browse files
alex-harvey-z3qgimmyxd
authored andcommitted
(MODULES-9981) Add Amazon Linux 2 support (#444)
* (MODULES-9981) Add Amazon Linux 2 support This adds Amazon Linux 2 support in tasks/install_shell.sh. Tested manually on Amazon Linux 2. * (MODULES-9981) Minor tweak to previous commit In the context of the Puppet Terraform provisioner, I observed puppetlabs-facts return the platform as "Amazon Linux". When I logged onto an Amazon Linux 2 instance, installed Puppet, then did puppet module install puppetlabs-facts and then ran the line manually, it returned "Amzn". I don't know why but it seems sensible to support both, which is what this patch does.
1 parent 68b2226 commit 78e08fa

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ detected>"}`. If a version cannot be found, returns `{"version": null}`.
299299

300300
#### `puppet_agent::install`
301301

302-
Installs the puppet-agent package. Currently only supports Linux variants: Debian, Ubuntu, SLES, RHEL/CentOS/Fedora. A specific
302+
Installs the puppet-agent package. Currently only supports Linux variants: Debian, Ubuntu, SLES, RHEL/CentOS/Fedora, Amazon Linux 2. A specific
303303
package `version` can be specified; if not, will install or upgrade to the latest Puppet 5 version available.
304304

305305
**Note**: The `puppet_agent::install_shell` task requires the `facts::bash` implementation from the [facts](https://forge.puppet.com/puppetlabs/facts) module. Both the `puppet_agent` and `facts` modules are packaged with Bolt. For use outside of Bolt make sure the `facts` module is installed to the same `modules` directory as `puppet_agent`.

tasks/install_shell.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ case $platform in
192192
"SLES")
193193
platform_version=$major_version
194194
;;
195+
"Amzn"|"Amazon Linux")
196+
case $platform_version in
197+
"2") platform_version="7";;
198+
esac
199+
;;
195200
esac
196201

197202
# Find which version of puppet is currently installed if any
@@ -463,6 +468,12 @@ case $platform in
463468
filename="${collection}-release-el-${platform_version}.noarch.rpm"
464469
download_url="${yum_source}/${filename}"
465470
;;
471+
"Amzn"|"Amazon Linux")
472+
info "Amazon platform! Lets get you an RPM..."
473+
filetype="rpm"
474+
filename="${collection}-release-el-${platform_version}.noarch.rpm"
475+
download_url="${yum_source}/${filename}"
476+
;;
466477
"Fedora")
467478
info "Fedora platform! Lets get the RPM..."
468479
filetype="rpm"

0 commit comments

Comments
 (0)