Ask Your Question
0

How to set and use environment variable in the same catalog run?

asked 2015-12-01 23:18:15 -0500

VeekshaVasanth gravatar image

updated 2015-12-01 23:35:32 -0500

I have a module which runs successfully after i do export {name}={value} manually, but if i unset the environment variable {name} and execute the puppet agent -t am getting error.

So , the module am referring is puppetlabs-aws and the variable {name} i have specified above is AWS_REGION.

"Error: Could not run: Puppet detected a problem with the information returned from AWS when looking up ec2vpcsubnet in us-east-1. The specific error was:

The vpc ID 'xxxxx' does not exist

Rather than report on ec2vpcsubnet resources in an inconsistent state we have exited. This could be because some other process is modifying AWS at the same time."

Note: vpc exists in the us-east-1 region

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-02 03:35:11 -0500

within your module could you try adding something like:

exec { ''awsconf':
 command => '/etc/profile.d/aws.sh',
 path    => '/usr/local/bin/:/bin/',
 user    => '0',

}

aws.sh would contain say:

export AWS_REGION=us-east-1

Cheers Stuart

edit flag offensive delete link more

Comments

Tried above, its not working still throwing the same error mentioned in the question.

VeekshaVasanth gravatar imageVeekshaVasanth ( 2015-12-02 04:36:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-12-01 23:18:15 -0500

Seen: 81 times

Last updated: Dec 02 '15