Created
October 19, 2015 10:52
-
-
Save neilmillard/774db984e7c396df66be to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Find the name from the user data passed in on instance creation | |
USER=$(curl -s "http://169.254.169.254/latest/user-data") | |
IFS=':' read -ra UDATA <<< "$USER" | |
# Find the instance ID from the meta data api | |
ID=$(curl -s "http://169.254.169.254/latest/meta-data/instance-id") | |
CERTNAME=${UDATA[1]}.$ID.aws | |
echo "Running Puppet for certname: " $CERTNAME | |
puppet agent -t --certname=$CERTNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment