Uses CloudFormation, cloud-init, and Ansible to provision and bootstrap three EC2 instances (an Ansible master node and two slave nodes)
The bootstrap process:
- Installs Ansible
- Download resources from S3
- Dynamically generates configuration files
- Clones a Git repository
- Executes an Ansible playbook to configure the other two slave instances
- AWS account
- AWS CLI
- IAM user with sufficient privileges + access key
- Run
aws configureto set the desired region, access key, secret access key - Create a key pair in the desired AWS region
- Download the private key
- Upload the private key to a S3 bucket (do not make public)
- Edit
create-stack.shas necessary: EC2SshKeyshould match the name you gave to the key pair you created in AWSS3LocationOfPrivateKeyis the fully qualified location of the private key stored in an S3 bucketGitHubRepositoryis the Git repository that contains the Ansible playbook you will runAnsiblePlaybookis the name of the Ansible playbook to run on the slave nodes- See
cfn-template.jsonfor complete list of parameters - Run
./create-stack.shto provison and configure all resources.
- When finished, run
./delete-stack.shto tear down all resources.