, Bootstrap.
git ansible-vault S3 ( IAM ) git.
EC2: pip install ansible, get secret key from S3, get playbook from git repository execute ansible-playbook.
EC2, S3 git .
.
Update01:
EC2 ( ):
#!/bin/bash
yum update -y
pip install -y ansible
aws s3 cp s3://mybucket/web/git_secret_key /root/.ssh/git_secret_key
chmod 600 /root/.ssh/git_secret_key
aws s3 cp s3://mybucket/web/config /root/.ssh/config
chmod 600 /root/.ssh/config
aws s3 cp s3://mybucket/web/ansible_vault_secret_key /root/ansible_vault_secret_key
git clone git://github.com/foo/playbook.git
ansible-playbook -i playbook/inventory/web playbook/web.yml --vault-password-file /root/ansible_vault_secret_key
s3://mybucket/web/config :
Host github-bootstrap
User git
Port 22
HostName github.com
IdentityFile /root/.ssh/git_secret_key
TCPKeepAlive yes
IdentitiesOnly yes
Update02: . ( S3/ansible-vault)
EC2 ( ):
yum update -y
pip install -y ansible
echo "YOUR GIT SECRET KEY" > /root/.ssh/git_secret_key
chmod 600 /root/.ssh/git_secret_key
cat << EOT > /root/.ssh/config
Host github-bootstrap
User git
Port 22
HostName github.com
IdentityFile /root/.ssh/git_secret_key
TCPKeepAlive yes
IdentitiesOnly yes
EOT
chmod 600 /root/.ssh/config
git clone git://github.com/foo/playbook.git
ansible-playbook -i playbook/inventory/web playbook/web.yml