Skip to content

Commit

Permalink
working on the ruby-gems package in amazon linux bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BIAndrews committed Nov 12, 2015
1 parent 24fbf18 commit 4593d56
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ script: "bundle exec rake spec"
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
matrix:
exclude:
- rvm: 2.0.0
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_VERSION="~> 3.1.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 2.7.0"
28 changes: 14 additions & 14 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,30 @@
Class['epel'] -> Package[$pippkg]
}

$directory = dirname($aws_cli_ini_settings)

package { $pippkg:
ensure => 'installed',
}

package { $rubyjsonpkg:
ensure => 'installed',
if $rubyjsonpkg != undef {
package { $rubyjsonpkg:
ensure => 'installed',
}
}

package { $awscli:
ensure => 'installed',
provider => 'pip',
require => [Package[$pippkg],Package[$rubyjsonpkg]],
require => Package[$pippkg],
}

file { $directory:
ensure => directory,
require => Package[$awscli],
recurse => true,
}
if ($aws_secret_access_key != undef) and ($aws_access_key_id != undef) {

if $aws_access_key_id != undef {
$directory = dirname($aws_cli_ini_settings)
file { $directory:
ensure => directory,
require => Package[$awscli],
recurse => true,
}
ini_setting { 'aws_access_key_id setting':
ensure => present,
path => $aws_cli_ini_settings,
Expand All @@ -101,9 +102,6 @@
value => $aws_access_key_id,
require => File[$directory],
}
}

if $aws_secret_access_key != undef {
ini_setting { 'aws_secret_access_key setting':
ensure => present,
path => $aws_cli_ini_settings,
Expand All @@ -112,5 +110,7 @@
value => $aws_secret_access_key,
require => File[$directory],
}

}

}
11 changes: 7 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@

$aws_cli_ini_settings = '/root/.aws/credentials'

# It happens to be that packages are all named the same but I used a
# case just in case I'm wrong about SLES or they change in the future

case $::operatingsystem {
'RedHat', 'Amazon', 'Fedora', 'CentOS', 'Scientific', 'SLC', 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL': {
'RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC', 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL': {
$pippkg = 'python-pip'
$rubyjsonpkg = 'ruby-json'
$awscli = 'awscli'
$enable_epel = true
}
'Amazon': {
$pippkg = 'python-pip'
$rubyjsonpkg = 'rubygem18-json'
$awscli = 'awscli'
$enable_epel = true
}
'ubuntu', 'debian': {
$pippkg = 'python-pip'
$rubyjsonpkg = 'ruby-json'
Expand Down
11 changes: 10 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bryana-ec2tagfacts",
"version": "0.1.14",
"version": "0.1.15",
"author": "Bryan Andrews",
"summary": "AWS EC2 tags exported as puppet facts and AWS cli tool installed.",
"license": "Apache-2.0",
Expand All @@ -9,6 +9,15 @@
"issues_url": "https://github.com/BIAndrews/ec2tagfacts/issues",
"tags": ["aws", "ec2", "amazon", "tags", "facter"],
"operatingsystem_support": [
{
"operatingsystem":"Amazon",
"operatingsystemrelease": [
"2014.03",
"2014.09",
"2015.03",
"2015.09"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
Expand Down

0 comments on commit 4593d56

Please sign in to comment.