Created
July 31, 2015 01:53
-
-
Save adamgoucher/07e1a774b43619305139 to your computer and use it in GitHub Desktop.
So puppet lets you assign agents to 'environments', but that is done at the agent level. But of course you cannot manage the agent config until it has connected to the server to gets its node config blah blah blah catch 22. so i'm going to modify /etc/default/puppet to look like this in my custom ami in order to be able to pass in the environmen…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defaults for puppet - sourced by /etc/init.d/puppet | |
# Enable puppet agent service? | |
# Setting this to "yes" allows the puppet agent service to run. | |
# Setting this to "no" keeps the puppet agent service from running. | |
START=yes | |
for x in $(facter ec2_userdata); do | |
case $x in | |
puppet_environment*) | |
PUPPET_ENVIRONMENT=$(echo $x | cut -d= -f2) | |
;; | |
esac | |
done | |
# Startup options | |
if [ -n "$PUPPET_ENVIRONMENT" ]; then | |
DAEMON_OPTS="--environment=$PUPPET_ENVIRONMENT" | |
else | |
DAEMON_OPTS="" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment