Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
class codedeploy::config {

case $::osfamily {
case $facts['os']['name'] {
'RedHat', 'Amazon': {
file { $::codedeploy::config_location:
ensure => file,
Expand Down
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
16 changes: 6 additions & 10 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
class codedeploy::install {

case $::osfamily {
case $facts['os']['name'] {
'RedHat', 'Amazon': {
package { $::codedeploy::package_name:
ensure => present,
Expand All @@ -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,
Expand All @@ -45,7 +41,7 @@
}
}
default: {
fail("${::operatingsystem} not supported")
fail("${facts['os']['name']} not supported")
}
}
}
6 changes: 3 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -39,7 +39,7 @@
$verbose = true
}
default: {
fail("${::operatingsystem} not supported")
fail("${facts['os']['name']} not supported")
}
}

Expand Down
11 changes: 7 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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"
}
]
}
1 change: 0 additions & 1 deletion templates/codedeployagent.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'] %>