Created
March 8, 2016 22:48
-
-
Save dustinmm80/8b60cad9ee660b3775a0 to your computer and use it in GitHub Desktop.
Applying Conjur machine identity with CloudFormation interpolation
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
host_token={{ref('HostFactoryToken')}} | |
node_name={{ref('NodeName')}} | |
host_id=$node_name-$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
host_identity=/var/conjur/host-identity.json | |
CONJUR_HOST_IDENTITY_VERSION=v1.0.1 | |
CONJUR_SSH_VERSION=v1.2.5 | |
export HOME=/root | |
echo "Inserting hostfactory token and ID into $host_identity" | |
sed -i "s/%%HOST_TOKEN%%/${host_token}/" ${host_identity} | |
sed -i "s/%%HOST_ID%%/${host_id}/" ${host_identity} | |
echo "Running chef-solo conjur-host-identity]" | |
chef-solo -r https://github.com/conjur-cookbooks/conjur-host-identity/releases/download/${CONJUR_HOST_IDENTITY_VERSION}/conjur-host-identity-${CONJUR_HOST_IDENTITY_VERSION}.tar.gz -j ${host_identity} | |
echo "Running chef-solo recipe[conjur-ssh]" | |
chef-solo -r https://github.com/conjur-cookbooks/conjur-ssh/releases/download/${CONJUR_SSH_VERSION}/conjur-ssh-${CONJUR_SSH_VERSION}.tar.gz -o conjur-ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment