Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Load files based on AWS region

$
0
0
Hi, So, I have 2 EC2 instances in 2 different AWS regions. Both are installing certain packages. However, the configuration between both servers is slightly different, based on their AWS region. What I want to achieve is that depending on the AWS region, I load a different configuration file within a module. So in the piece below for example, I either want to load the config for Region 1 or config for Region 2. file { 'aws-config': path => '/opt/.aws/config', ensure => file, backup => false, owner => root, group => root, mode => 644, require => File['aws-directory'], source => "puppet:///modules/aws_our/config", } What is the best way to achieve this? Also in regards of templates rather then files. What is the best way to have different variables within a template, based on the region? I read about having multiple sources like this; source => [ "puppet://puppet/modules/aws_our/config$region", # Region file "puppet://puppet/modules/aws_our/config" # Default file ], How on earth can I get the region here?

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>