Giter VIP home page Giter VIP logo

puppet-awscli's Introduction

awscli

Build Status Puppet Forge Puppet Forge

Description

This Puppet module will install awscli. It is works with Debian, RedHat and OSX(Tested on Yosemite using boxen) based distros.

OSX has been tested on Yosemite only and requires:

Installation

puppet module install --modulepath /path/to/puppet/modules jdowning-awscli

Usage

class { 'awscli': }

There are some optional class parameters, documentation can be found in init.pp.

Profiles

You may want to add a credentials for awscli and can do so using awscli::profile. If you just define access_key_id and secret key, these credentials will work only for the root user:

awscli::profile { 'myprofile':
  aws_access_key_id     => 'MYAWSACCESSKEYID',
  aws_secret_access_key => 'MYAWSSECRETACESSKEY'
}

You can also define a profile for a custom user:

awscli::profile { 'myprofile2':
  user                  => 'ubuntu',
  aws_access_key_id     => 'MYAWSACCESSKEYID',
  aws_secret_access_key => 'MYAWSSECRETACESSKEY'
}

If the user has a non-standard ${HOME} location (/home/${USER} on Linux, /Users/${USER} on Mac OS X), you can specify the homedir explicitly:

awscli::profile { 'myprofile3':
  user                  => 'ubuntu',
  homedir               => '/tmp',
  aws_access_key_id     => 'MYAWSACCESSKEYID',
  aws_secret_access_key => 'MYAWSSECRETACESSKEY'
}

To remove a profile, simply set $ensure => 'absent'

awscli::profile { 'myprofile3':
  ensure => 'absent',
}

You can also define the profile's region and output format:

awscli::profile { 'myprofile4':
  user                  => 'ubuntu',
  aws_access_key_id     => 'MYAWSACCESSKEYID',
  aws_secret_access_key => 'MYAWSSECRETACESSKEY'
  aws_region            => 'eu-west-1',
  output                => 'text',
}

Finally, if you'd like to use a different profile name, you can specify profile_name directly as a parameter. You can read more in the aws-cli docs. (Note that this is a potentially breaking change if you depended on the $title for this previously):

awscli::profile { 'myprofile5':
  profile_name          => 'foo',
  user                  => 'ubuntu',
  aws_access_key_id     => 'MYAWSACCESSKEYID',
  aws_secret_access_key => 'MYAWSSECRETACESSKEY'
  aws_region            => 'eu-west-1',
  output                => 'text',
}

The above will result in a file ~ubuntu/.aws/config that looks like this:

[profile foo]
region=eu-west-1
output=text

and a file ~ubuntu/.aws/credentials that looks like this:

[foo]
aws_access_key_id=MYAWSACCESSKEYID
aws_secret_access_key=MYAWSSECRETACESSKEY

If you do not provide aws::profile::aws_access_key_id and awscli::profile::aws_secret_access_key, then the aws-cli tool can use IAM roles to authenticate a user's request.

Testing

You can test this module with rspec:

bundle install
bundle exec rake spec

Vagrant

You can also test this module in a Vagrant box. There are two box definitons included in the Vagrant file for CentOS and Ubuntu testing. You will need to use librarian-puppet to setup dependencies:

bundle install
bundle exec librarian-puppet install

To test both boxes:

vagrant up

To test one distribution:

vagrant up [centos|ubuntu]

puppet-awscli's People

Contributors

adamjk-dev avatar albac avatar bryangwilliam avatar clambertus avatar cubiclelord avatar darwish avatar egypcio avatar jdowning avatar jgnagy avatar jre21 avatar koubas avatar mosheeshel avatar mpdude avatar mvolhontseff avatar paschdan avatar phpguru avatar vide avatar vladistan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-awscli's Issues

https now required

For the last couple of weeks, this module has been throwing the following error:

==> default: Error: Could not get latest version: HTTP-Error: 403 Must access using HTTPS instead of HTTP
==> default: Error: /Stage[main]/Awscli/Package[awscli]/ensure: change from 1.10.38 to latest failed: Could not get latest version: HTTP-Error: 403 Must access using HTTPS instead of HTTP

I'm calling it like so:

class { 'awscli':
version => 'latest',
}

And I can't find where to configure this. Any suggestions?

Issues with puppetlabs-concat versions?

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 10 is not a string. It looks to be a Fixnum at /etc/puppetlabs/code/environments/production/modules/concat/manifests/fragment.pp:43:3 at /etc/puppetlabs/code/environments/production/modules/awscli/manifests/profile.pp:101 on node testhost

I'm getting the above error when trying to use create_resources with awscli::profile. Per #40 locking puppetlabs-concat to version '1.2.0' appears to resolve the issue.

I can see that the metadata.json in puppetlabs-concat says it's version 2.2.0, but the forge still lists 1.1.0 as the latest version. And locking the version to 1.2.0 solves the problem.

I'm unfamiliar enough with puppet that I'm hoping someone else can solve that.

Support for additional config options

AWS CLI seems to support other config options next to profiles. For example:

    [preview]
    cloudfront=true

(currently needed for http://docs.aws.amazon.com/cli/latest/reference/cloudfront/index.html)

I am opening this issue to discuss options for implementing this. I currently see two options: either a awscli::preview resource type, or maybe better: a general awscli::configsetting type. The latter might also be used to implement the current awscli::profile.

Any thoughts?

Suggestion: assume python is installed

Hi,
I've tried to use this module and it conflicted when tried to install python-* packages with another module(puppet-circus).

'puppet-circus' module assumes that python/pip/virtualenv are already installed and only installs circus related stuff.

Option 1, Specify 'install_python' Boolean parameter to control python installation.
Option 2, Similarly to puppet-circus, remove any python installation related code and inform the user that Python/Pip/other should be available on the host

Thank you,
Yarden

Inability to define the same profile for multiple users

Because the $title of a resource is used to define a profile name within .aws/credentials, you cannot create the same profile for multiple users; i.e. 'default'. If you attempt to do this, a puppet run will result in duplicate declaration errors.

Resource declarations can be used multiple times in puppet, as opposed to classes (which is one of the main things that differentiate them). This is useful when you want to create multiple files, multiple vhosts, multiple aws creds:

Example:
foo::bar { ‘title’: }
foo::bar { ‘title2’: }
foo::bar { ‘title3’: }

The restriction here is that the resource title must be unique, otherwise you trigger a duplicate declaration error.

Because 'title' is used as a variable within an ERB template for profile creation (i.e., title3 “becomes” the profile name), this approach prohibits you from defining the same profile for different users. As we know, it is very practical to use ‘default’ for different users, as that is what the AWS SDK will use, by default.

The solution is to move the profile name out of the title into a param, and make the corresponding adjustments to variable assignments and .erb template. Thus, you can adhere to the “unique title” requirement of puppet, avoid dup declarations, and still support multiple user accounts using the same profile name, i.e., “default”. Example:

define aws_creds::profile(
$user = 'root',
$aws_profile = 'default',
$aws_access_key_id = undef,
$aws_secret_access_key = undef,
) {
if $aws_access_key_id == undef {
fail ('no aws_access_key_id provided')
}

...
...
concat::fragment{ "${user}${aws_profile}":
target => "${homedir}/.aws/credentials",
content => template('aws_creds/credentials_concat.erb')
}
}

concat.erb:
[<%=@aws_profile%>]
aws_access_key_id=<%=@aws_access_key_id%>
aws_secret_access_key=<%=@aws_secret_access_key%>

Generated config for named profiles are missing 'profile' keyword

Based on http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles:

The AWS credentials file uses a different naming format than the CLI config file for named profiles. Do not include the 'profile ' prefix when configuring a named profile in the AWS credentials file.

That means, if you have a profile [user2] in ~/.aws/credentials, then the corresponding profile in ~/.aws/config should be [profile user2]. Currently, the generated ~/.aws/config is missing the profile for profile names.

Default file mode is world-readable

Precondition:

  • VM with puppet-server-3.3.1 installed
    • /etc/puppet/manifests/nodes.pp containing an empty node definition for the agent VM
    • /etc/puppet/manifests/site.pp containing a directive to import the nodes file
  • VM with Puppet agent installed and provisioned to communicate with the master

Steps to reproduce:

  1. On the Puppet master, in the empty node definition, add a block that will invoke awscli::profile with an AWS access key ID, secret access key, and region:
  awscli::profile { 'AWSProfile':
    aws_access_key_id => '[redacted]',
    aws_secret_access_key => '[redacted]',
    aws_region => 'us-east-1',
  }
  1. Update (apply) the catalog with the new changes
  2. In the Puppet agent VM as a non-root user, apply the update:
sudo puppet agent --test --no-daemonize --server [host name of master VM]
  1. In the Puppet agent VM as a non-root user, explore the contents of the newly-created .aws metadata folder in the root user's home:
sudo ls -al /root/.aws

Expected:
The mode of the .aws folder and its contents should, by default, disallow global read access. The official AWS client creates the .aws folder with a mode of 0700 and the files within with a mode of 0600.

Actual:
The mode of the .aws folder and contents are 0755 and 0644 respectively, given the default umask is 0002.

Allow setting proxy for the EPEL module

Right now, the module does an 'include epel', but for those who have to set a proxy, they need to be able to pass that param into that module.

What I had to do:

  1. deps.pp:
class awscli::deps (
  $proxy = $awscli::params::proxy,
) inherits awscli::params {
  case $::osfamily {
    'Debian': {
      include awscli::deps::debian
    }
    'RedHat': {
      class { 'awscli::deps::redhat':
        proxy => $proxy,
      }
    }
    'Darwin': {
      include awscli::deps::osx
    }
    default:  { fail("The awscli module does not support ${::osfamily}") }
  }
}
  1. redhat.pp:
class awscli::deps::redhat (
  $proxy = $awscli::params::proxy,
) inherits awscli::params {
  # Check if we have a proxy to setup with EPEL
  if $proxy != undef {
    class { '::epel':
      epel_proxy => $proxy,
    }
  }
  else {
    include ::epel
  }
  Package { require => Class['epel'] }

  if $awscli::install_pkgdeps {
    if ! defined(Package[ $awscli::pkg_dev ]) {
      package { $awscli::pkg_dev: ensure => installed }
    }
  }
  if $awscli::install_pip {
    if ! defined(Package[ $awscli::pkg_pip ]) {
      package { $awscli::pkg_pip: ensure => installed }
    }
  }
}
  1. init.pp:
class awscli (
  $version         = 'present',
  $pkg_dev         = $awscli::params::pkg_dev,
  $pkg_pip         = $awscli::params::pkg_pip,
  $install_pkgdeps = true,
  $install_pip     = true,
  $proxy           = $awscli::params::proxy,
) inherits awscli::params {
  # Handle dependencies
  class { 'awscli::deps':
    proxy => $proxy,
  }
  1. params.pp:
class awscli::params {

  $proxy = undef

  case $::osfamily {

Support credential_source

In order to use the built-in credentials of an AWS instance, this profile property needs to be supported.

credential_source - The credential provider to use to get credentials for the initial assume-role call. This parameter cannot be provided alongside source_profile. Valid values are:

Environment to pull source credentials from environment variables.
Ec2InstanceMetadata to use the EC2 instance role as source credentials.
EcsContainer to use the ECS container credentials as the source credentials.

Invalid parameter show_diff

I'm trying to test out your module and I can't get it to run. I'm making a simple class and running it inside vagrant (same box as your demo). Puppetfile is attached. Am I missing something?

config.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box'

== Class awsads

class awsads {

notify{ "GOT TO THE CLASS":}

include ::stdlib
include ::awscli

awscli::profile { 'default':
user => 'root',
aws_access_key_id => 'ACCESSKEY',
aws_secret_access_key => 'SECRETKEY',
aws_region => 'us-west-2'
}
}

--------------PUPPETFILE----------

forge "https://forgeapi.puppetlabs.com"

mod 'stahnma/epel', :latest
mod 'puppetlabs/inifile', :latest
mod 'puppetlabs-stdlib'
mod 'jdowning-awscli'
mod 'puppetlabs-concat'


=> default: Error: /Stage[main]/Awsads/Awscli::Profile[default]/Concat[/root/.aws/credentials]/Concat_file[/root/.aws/credentials]: Failed to generate additional resources using 'generate': Invalid parameter show_diff
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/errors.rb:60:in fail' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:642:in[]='
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2240:in block in set_parameters' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2234:ineach'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2234:in set_parameters' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2196:ininitialize'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type/file.rb:400:in initialize' ==> default: /tmp/vagrant-puppet/modules-41ee50e0bca8a8f9e6ee7d005b41df51/concat/lib/puppet/type/concat_file.rb:205:innew'
==> default: /tmp/vagrant-puppet/modules-41ee50e0bca8a8f9e6ee7d005b41df51/concat/lib/puppet/type/concat_file.rb:205:in generate' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:202:ingenerate_additional_resources'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:222:in block in add_dynamically_generated_resources' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:222:ineach'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:222:in add_dynamically_generated_resources' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:94:inevaluate'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/resource/catalog.rb:144:in apply' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:122:inblock in apply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:179:in block in benchmark' ==> default: /opt/ruby/lib/ruby/1.9.1/benchmark.rb:295:inrealtime'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:178:in benchmark' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:121:inapply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:179:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:265:inapply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:213:in main' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:146:inrun_command'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in block (2 levels) in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:456:inplugin_hook'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in block in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:504:inexit_on_fail'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:132:inrun'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:86:in execute' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/bin/puppet:4:in<top (required)>'
==> default: /opt/ruby/bin/puppet:23:in load' ==> default: /opt/ruby/bin/puppet:23:in

'
==> default: Error: /Stage[main]/Awsads/Awscli::Profile[default]/Concat[/root/.aws/config]/Concat_file[/root/.aws/config]: Failed to generate additional resources using 'generate': Invalid parameter show_diff
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/errors.rb:60:in fail' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:642:in[]='
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2240:in block in set_parameters' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2234:ineach'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2234:in set_parameters' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type.rb:2196:ininitialize'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/type/file.rb:400:in initialize' ==> default: /tmp/vagrant-puppet/modules-41ee50e0bca8a8f9e6ee7d005b41df51/concat/lib/puppet/type/concat_file.rb:205:innew'
==> default: /tmp/vagrant-puppet/modules-41ee50e0bca8a8f9e6ee7d005b41df51/concat/lib/puppet/type/concat_file.rb:205:in generate' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:202:ingenerate_additional_resources'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:222:in block in add_dynamically_generated_resources' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:222:ineach'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:222:in add_dynamically_generated_resources' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:94:inevaluate'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/resource/catalog.rb:144:in apply' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:122:inblock in apply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:179:in block in benchmark' ==> default: /opt/ruby/lib/ruby/1.9.1/benchmark.rb:295:inrealtime'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:178:in benchmark' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:121:inapply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:179:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:265:inapply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:213:in main' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:146:inrun_command'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in block (2 levels) in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:456:inplugin_hook'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in block in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:504:inexit_on_fail'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:132:inrun'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:86:in execute' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/bin/puppet:4:in<top (required)>'
==> default: /opt/ruby/bin/puppet:23:in load' ==> default: /opt/ruby/bin/puppet:23:in'
==> default: Info: Applying configuration version '1476402450'
==> default: Debug: /Stage[setup]/before: requires Stage[main]
==> default: Debug: /Stage[runtime]/require: requires Stage[main]
==> default: Debug: /Stage[runtime]/before: requires Stage[setup_infra]
==> default: Debug: /Stage[setup_infra]/before: requires Stage[deploy_infra]
==> default: Debug: /Stage[deploy_infra]/before: requires Stage[setup_app]
==> default: Debug: /Stage[setup_app]/before: requires Stage[deploy_app]
==> default: Debug: /Stage[deploy_app]/before: requires Stage[deploy]
==> default: Debug: /Stage[main]/Awscli/Package[awscli]/require: requires Class[Awscli::Deps]
==> default: Debug: /Stage[main]/Awsads/Awscli::Profile[default]/Concat[/root/.aws/credentials]/Concat_file[/root/.aws/credentials]: Autorequiring Concat_fragment[default-credentials]
==> default: Debug: /Stage[main]/Awsads/Awscli::Profile[default]/Concat[/root/.aws/config]/Concat_file[/root/.aws/config]: Autorequiring Concat_fragment[default-config]
==> default: Debug: /Schedule[daily]: Skipping device resources because running on a host
==> default: Debug: /Schedule[monthly]: Skipping device resources because running on a host
==> default: Debug: /Schedule[hourly]: Skipping device resources because running on a host
==> default: Notice: THIS FUCKING SUCKS
==> default: Notice: /Stage[main]//Notify[THIS FUCKING SUCKS]/message: defined 'message' as 'THIS FUCKING SUCKS'
==> default: Debug: /Stage[main]//Notify[THIS FUCKING SUCKS]: The container Class[Main] will propagate my refresh event
==> default: Debug: Prefetching apt resources for package
==> default: Debug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n''
==> default: Debug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n''
==> default: Debug: /Schedule[never]: Skipping device resources because running on a host
==> default: Debug: /Schedule[weekly]: Skipping device resources because running on a host
==> default: Notice: GOT TO THE CLASS
==> default: Notice: /Stage[main]/Awsads/Notify[GOT TO THE CLASS]/message: defined 'message' as 'GOT TO THE CLASS'
==> default: Debug: /Stage[main]/Awsads/Notify[GOT TO THE CLASS]: The container Class[Awsads] will propagate my refresh event
==> default: Error: /Stage[main]/Awsads/Awscli::Profile[default]/Concat[/root/.aws/credentials]/Concat_file[/root/.aws/credentials]: Failed to generate additional resources using 'eval_generate: undefined method []=' for nil:NilClass ==> default: /tmp/vagrant-puppet/modules-41ee50e0bca8a8f9e6ee7d005b41df51/concat/lib/puppet/type/concat_file.rb:212:ineval_generate'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:151:in eval_generate' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:380:intraverse'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:98:in evaluate' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/resource/catalog.rb:144:inapply'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:122:in block in apply_catalog' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:179:inblock in benchmark'
==> default: /opt/ruby/lib/ruby/1.9.1/benchmark.rb:295:in realtime' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:178:inbenchmark'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:121:in apply_catalog' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:179:inrun'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:265:in apply_catalog' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:213:inmain'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:146:in run_command' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:inblock (2 levels) in run'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:456:in plugin_hook' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:inblock in run'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:504:in exit_on_fail' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:inrun'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:132:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:86:inexecute'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/bin/puppet:4:in <top (required)>' ==> default: /opt/ruby/bin/puppet:23:inload'
==> default: /opt/ruby/bin/puppet:23:in <main>' ==> default: Debug: /Schedule[puppet]: Skipping device resources because running on a host ==> default: Debug: Class[Main]: The container Stage[main] will propagate my refresh event ==> default: Error: /Stage[main]/Awsads/Awscli::Profile[default]/Concat[/root/.aws/config]/Concat_file[/root/.aws/config]: Failed to generate additional resources using 'eval_generate: undefined method[]=' for nil:NilClass
==> default: /tmp/vagrant-puppet/modules-41ee50e0bca8a8f9e6ee7d005b41df51/concat/lib/puppet/type/concat_file.rb:212:in eval_generate' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:151:ineval_generate'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:380:in traverse' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/transaction.rb:98:inevaluate'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/resource/catalog.rb:144:in apply' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:122:inblock in apply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:179:in block in benchmark' ==> default: /opt/ruby/lib/ruby/1.9.1/benchmark.rb:295:inrealtime'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:178:in benchmark' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:121:inapply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/configurer.rb:179:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:265:inapply_catalog'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:213:in main' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application/apply.rb:146:inrun_command'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in block (2 levels) in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:456:inplugin_hook'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in block in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util.rb:504:inexit_on_fail'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/application.rb:364:in run' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:132:inrun'
==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:86:in execute' ==> default: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.1.1/bin/puppet:4:in<top (required)>'
==> default: /opt/ruby/bin/puppet:23:in load' ==> default: /opt/ruby/bin/puppet:23:in'

Specify AWS Region

Hi,

Appart from specifying the credentials I want to specify the region name to my ~/.aws/credentials file. Because if you give a role to an ec2 instance and then you install aws-cli with your module just including it by puppet in a node you don't need any credentials, you only need the region to work and I can't find where to specify it.

module dependencies

stdlib and concat are already on version > 6. Please update metadata.json

PUP-4997 - pip provider on RHEL problem

Running puppet on RHEL 6,

# cat /etc/*release
Red Hat Enterprise Linux Server release 6.8

# puppet --version
3.6.2 (Puppet Enterprise 3.3.1)
Error: Could not set 'present' on ensure: Could not locate the pip command. at 46:/opt/puppet/share/puppet/modules/awscli/manifests/init.pp
Error: Could not set 'present' on ensure: Could not locate the pip command. at 46:/opt/puppet/share/puppet/modules/awscli/manifests/init.pp
Wrapped exception:
Could not locate the pip command.
Error: /Stage[main]/Awscli/Package[awscli]/ensure: change from absent to present failed: Could not set 'present' on ensure: Could not locate the pip command. at 46:/opt/puppet/share/puppet/modules/awscli/manifests/init.pp

I wasn't sure what the "best" fix would be for the module overall, but for this version of Puppet, the workaround I did was this:

In manifests/init.pp:

class awscli (
  $version = 'present',
  $pkg_dev = $awscli::params::pkg_dev,
  $pkg_pip = $awscli::params::pkg_pip
) inherits awscli::params {
  include awscli::deps

  # Workaround for PUP-4997/3829
  file { '/usr/bin/pip-python':
    ensure => 'link',
    target => '/usr/bin/pip',
  }

  package { 'awscli':
    ensure   => $version,
    provider => 'pip',
    require  => [
      Package['python-pip'],
      Class['awscli::deps'],
      File['/usr/bin/pip-python'],
    ],
  }
}

Support puppet 5

The metadata only supports up to puppet 4.x

  "requirements": [
    {
      "name": "puppet",
      "version_requirement": ">= 3.4.3 < 5.0.0"
    }

It would be great if it also supported puppet 5 and 6.

Need install_options for pip install for awscli so we can set the proxy variable

Currently, there is no way to pass a proxy variable to the package command to install awscli via pip.

Something like this:

package { 'awscli':
  ensure   => $version,
  provider => 'pip',
  install_options => '--proxy $proxy'
  require  => [
    Package['python-pip'],  
    Class['awscli::deps'],
  ],
 }

And, should likely make $proxy a class parameter to the init class, and perhaps a default in params.pp. Or, perhaps switch over the presence of a $proxy variable and have two resources for package (one that uses the proxy, one that doesn't).

Dependencies fail on RHEL 6.5

The dependencies look for python-dev, however on RHEL 6.5 the package is called python-devel as such it fails.

yum search python-dev

...
python-devel.i686 : The libraries and header files needed for Python development
python-devel.x86_64 : The libraries and header files needed for Python development
...

"Could not locate the pip command. at 45:" @CentOS 6.7

looks like something is wrong here?!

Error: Could not set 'present' on ensure: Could not locate the pip command. at 45:/etc/puppet/modules/awscli/manifests/init.pp Error: Could not set 'present' on ensure: Could not locate the pip command. at 45:/etc/puppet/modules/awscli/manifests/init.pp Wrapped exception: Could not locate the pip command. Error: /Stage[main]/Awscli/Package[awscli]/ensure: change from absent to present failed: Could not set 'present' on ensure: Could not locate the pip command. at 45:/etc/puppet/modules/awscli/manifests/init.pp

Thanks for your help.

Forge Release?

Hi there! Could you please release the current version of master to the Puppet forge? There's some goodies (including IAM role support) we're using from a few months back that isn't available in 1.2.0. Thanks!

1.2.0...master

requires PIP but doesn't install it

Error: Could not set 'present' on ensure: Could not locate the pip command. at 33:/tmp/modules/awscli/manifests/init.pp
Error: Could not set 'present' on ensure: Could not locate the pip command. at 33:/tmp/modules/awscli/manifests/init.pp

Concat dependency annoyance

Hey,

Can you please update your module on forge.puppet.com ???

Warning: Module 'puppetlabs-concat' (v2.2.0) fails to meet some dependencies:
  'jdowning-awscli' (v1.3.0) requires 'puppetlabs-concat' (>= 1.0.0 <2.0.0)
  1. Here on github in metadata.json you have
{ "name": "puppetlabs/concat", "version_requirement": ">= 1.0.0 <3.0.0" }
  1. In module from forge.puppet.com, same version module v1.3.0 has different metadata.json
{"name":"puppetlabs/concat","version_requirement":">= 1.0.0 <2.0.0"}

Also concat is v4.0.0 now so prabably dependecy needs to be updated to <5.0.0

Continually trying to upgrade awscli

Hi,

I have installed this module into Puppet Enterprise and I am running it against RHEL 6.5.

The puppet logs for the node are constantly showing

notice ensure changed '1.4.1' to '1.4.2' /Stage[main]/Awscli/Package[awscli]/ensure

I am assuming this is pip trying to update awscli from v1.4.1 to v1.4.2?

But it never works and hence tries to apply it every time.

AmazonLinux Support

Can we please add support for Amazon Linux. I know it comes pre-installed with AWS Cli. but for version management and etc it might be helpful.

Test fails after clean clone run

Reproduction steps:

  1. /home/david/.gem/ruby/2.3.0/bin/bundle install --path vendor/bundle

  2. /home/david/.gem/ruby/2.3.0/bin/bundle exec rake spec :

/home/david/.gem/ruby/2.3.0/bin/bundle exec rake spec 
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/defaults.rb:488: warning: key :queue_type is duplicated and overwritten on line 489
rake aborted!
NameError: uninitialized constant Syck
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb:42:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:197:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:197:in `<module:YAML>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:132:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor/require_vendored.rb:4:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor/require_vendored.rb:4:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor.rb:40:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor.rb:40:in `require_libs'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet/vendor.rb:53:in `load_vendored'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet.rb:172:in `<module:Puppet>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppet-3.7.5/lib/puppet.rb:29:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/metadata-json-lint-2.1.0/lib/metadata-json-lint/semantic_puppet_loader.rb:21:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/metadata-json-lint-2.1.0/lib/metadata-json-lint/semantic_puppet_loader.rb:21:in `try_load_puppet'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/metadata-json-lint-2.1.0/lib/metadata-json-lint/semantic_puppet_loader.rb:5:in `try_load'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/metadata-json-lint-2.1.0/lib/metadata_json_lint.rb:6:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/metadata-json-lint-2.1.0/lib/metadata-json-lint/rake_task.rb:3:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/metadata-json-lint-2.1.0/lib/metadata-json-lint/rake_task.rb:3:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppetlabs_spec_helper-2.6.2/lib/puppetlabs_spec_helper/rake_tasks.rb:11:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/puppetlabs_spec_helper-2.6.2/lib/puppetlabs_spec_helper/rake_tasks.rb:11:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/Rakefile:2:in `require'
/home/david/code/puppet-r10k/modules/puppet-awscli/Rakefile:2:in `<top (required)>'
/home/david/code/puppet-r10k/modules/puppet-awscli/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)

Happens with both master and tag 2.0.0.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.