Step 2: Build Stack - Alex-Burgess/ansible-demo GitHub Wiki
The CloudFormation stack templates the building of the infrastructure for this demo. The infrastructure is separated into two distinct areas:
- Base stack - Containing the VPC, Security Groups, IAM roles and profiles and Ansible Controller instances.
- Webservers Stack - Built for each web application environment, containing the webserver instances.
Build the Base Stack and a Webservers stack for just the test environment of a demo web application.
- Checkout the git repository:
git clone [email protected]:Alex-Burgess/AnsibleWebDemo.git - Upload CloudFormation template to repo bucket (Note - update bucket name):
$ cd AnsibleHelloWorld/cloudformation $ aws s3 sync . s3://ansible-hello-world/cloudformation/ --delete - Create base stack using default input params in the params_base.json file:
$ aws cloudformation create-stack \ --stack-name AnsibleDemo \ --template-url https://s3.amazonaws.com/ansible-hello-world/cloudformation/base.template \ --parameters file://params_base.json \ --capabilities CAPABILITY_NAMED_IAM - Create the webserver stack for the test environment of the AnsibleDemo web application:
$ aws cloudformation create-stack \ --stack-name AnisbleWebServersDemo \ --template-url https://s3.amazonaws.com/ansible-hello-world/cloudformation/webservers.template \ --parameters file://params_demo.json \ --capabilities CAPABILITY_NAMED_IAM
Next: Step 3 - Use Ansible to deploy demo web application to test environment