diff --git a/README.markdown b/README.markdown index bb7498c..7c82271 100644 --- a/README.markdown +++ b/README.markdown @@ -15,6 +15,11 @@ This module installs and enables the AWS CodeDeploy agent. + +## IMPORTANT + +You must manually define `File['/usr/local/bin/aws']` in your upstream project somewhere. + ## Module Description The AWS Codedeploy allows you to automatically deploy applications to AWS instances from S3 or GitHub. This module installs any required packages followed by the CodeDeploy agent. It then enables the codedeploy-agent service and ensures that it is running. diff --git a/manifests/config.pp b/manifests/config.pp index 2af0356..d164bf6 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -4,7 +4,7 @@ # class codedeploy::config { - case $::osfamily { + case $facts['os']['name'] { 'RedHat', 'Amazon': { file { $::codedeploy::config_location: ensure => file, diff --git a/manifests/init.pp b/manifests/init.pp index 2ab1c58..54b197b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,7 +19,6 @@ $root_dir = $::codedeploy::params::root_dir, $verbose = $::codedeploy::params::verbose, $wait_between_runs = $::codedeploy::params::wait_between_runs, - $proxy_uri = $::codedeploy::params::proxy_uri, $max_revisions = $::codedeploy::params::max_revisions, ) inherits ::codedeploy::params { diff --git a/manifests/install.pp b/manifests/install.pp index 9c2821d..a36363c 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,7 +4,7 @@ # class codedeploy::install { - case $::osfamily { + case $facts['os']['name'] { 'RedHat', 'Amazon': { package { $::codedeploy::package_name: ensure => present, @@ -18,17 +18,13 @@ source => $::codedeploy::package_url, } } - 'Debian': { - if ! defined(Package['awscli']) { - package { 'awscli': - ensure => present, - } - } + 'Debian', 'Ubuntu': { exec { 'download_codedeploy_installer': - command => '/usr/bin/aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1', + command => 'aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1', cwd => '/tmp', creates => '/tmp/install', - require => Package['awscli'], + path => ['/usr/bin', '/usr/local/bin'], + require => File['/usr/local/bin/aws'], } file { '/tmp/install': ensure => file, @@ -45,7 +41,7 @@ } } default: { - fail("${::operatingsystem} not supported") + fail("${facts['os']['name']} not supported") } } } diff --git a/manifests/params.pp b/manifests/params.pp index 4f0dc21..d937a0d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,8 +4,8 @@ # It sets variables according to platform. # class codedeploy::params { - case $::osfamily { - 'Debian': { + case $facts['os']['name'] { + 'Debian', 'Ubuntu': { $package_url = 'https://s3.amazonaws.com/aws-codedeploy-us-east-1/latest/codedeploy-agent_all.deb' $package_name = 'codedeploy-agent' $service_name = 'codedeploy-agent' @@ -39,7 +39,7 @@ $verbose = true } default: { - fail("${::operatingsystem} not supported") + fail("${facts['os']['name']} not supported") } } diff --git a/metadata.json b/metadata.json index 72f3911..7db2d40 100644 --- a/metadata.json +++ b/metadata.json @@ -11,7 +11,7 @@ "dependencies": [ { "name": "puppetlabs-stdlib", - "version_requirement": ">=3.2.0 <7.0.0" + "version_requirement": ">=3.2.0 <10.0.0" } ], "operatingsystem_support": [ @@ -32,18 +32,21 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "14.04" + "14.04", + "20.04", + "22.04", + "24.04" ] } ], "requirements": [ { "name": "pe", - "version_requirement": ">= 3.2.0 < 2015.4.0" + "version_requirement": ">= 3.2.0 < 2023.7.0" }, { "name": "puppet", - "version_requirement": ">= 3.4.0 < 5.0.0" + "version_requirement": ">= 3.4.0 < 9.0.0" } ] } diff --git a/templates/codedeployagent.yml.erb b/templates/codedeployagent.yml.erb index f4365c7..d3bcd72 100644 --- a/templates/codedeployagent.yml.erb +++ b/templates/codedeployagent.yml.erb @@ -11,5 +11,4 @@ :root_dir: <%= scope['codedeploy::root_dir'] %> :verbose: <%= scope['codedeploy::verbose'] %> :wait_between_runs: <%= scope['codedeploy::wait_between_runs'] %> -:proxy_uri: <%= scope['codedeploy::proxy_uri'] %> :max_revisions: <%= scope['codedeploy::max_revisions'] %>