This is a basic POC to show capabilities of SSM State Manager Document AWS-ApplyAnsiblePlaybooks.
- Create an EC2 instance, a SSM State Manager Association will be created and apply a provision playbook to the instance.
- If the instance is stopped, then started again, the Association will be updated and apply an update playbook to the instance.
- Terminate the instance, the Association will be deleted.
Execute the commands in each of the following sections:
The following should be the end result:
- Create an EC2 instance in the private subnet of the vpc created by ssm_network,
assign the role created by ssm_global to the instance, and a tag of
Key:ManagedBy, Value:Ansible.
- An SSM State Manager Association will be created and apply a provision playbook to the instance.
- If the instance is stopped, then started again, the Association will be updated and apply an update playbook to the instance.
- Terminate the instance, the Association will be deleted.
Workflow of above:
I'm by no means an expert in Ansible or Python, so I know some of what I've done probably isn't best practices.