This message was deleted.
# forge-modules
s
This message was deleted.
t
awscli::profile
is a defined type, not a class, you can't use Hiera for that directly.
Wrap it in your own class and explicitly define the resource in there, then you can pass the variables via hiera. The roles & profiles model suits itself well for this kind of thing, if you aren't already using it.
😀 1
t
i ended up modifying this module to do what I needed.
I added this to the config.pp
Copy code
class awscli2::config {
    
  #########################
  #adds files and folders
  #########################
  file { '/root/.aws':
    ensure  => directory,
  }

  file { '/root/.aws/credentials':
    ensure  => 'file',
    require =>  File['/root/.aws'] ,
    content => template('awscli2/credentials.erb'),
  }

  file { '/root/.aws/config':
    ensure  => present,
    content  => template('awscli2/aws-config.erb'),
    require => [ File['/root/.aws'] ] ,
  }

}
I also added a new yaml entry:
Copy code
class awscli2 (
  String[1]                 $version,
  Enum['absent', 'present'] $ensure = 'present',
  String[1]                 $install_dir = '/usr/local/aws-cli',
  String[1]                 $bin_dir = '/usr/bin',
  String $aws_access_key_id, 
  String $aws_secret_access_key
) {
There seems to be a bug also that I fixed. install.pp
Copy code
#line 54 of install.pp original if $need_upgrade { 
    if $need_upgrade == true {
      $extra_args = [ '--update' ]
    } else {
      $extra_args = []
    }