Ansible playbook to switch whole environment on/off It will do the following:
- Start / Stop Elasticache servers
- Start / Stop EC2 Instances matching a certain tag
- Scale down ASG groups defined
Ansible 2.x
All of the variables are set in vars/default.yml
Variable | Description | Default |
---|---|---|
environment_base_domain |
Base domain on which elasticache servers will reside | test.com |
environment_region |
Region in which script is run | eu-west-1 |
environment_tag |
EC2 Instance Tag Key | Environment |
environment_cache_servers |
List of elastcache servers to start, with parameters | {} |
environment_asg_groups |
List of ASG groups to scale up/down | {} |
ansible-playbook -i ec2.py stop_environment.yml -e "env=staging"
MIT / BSD
Kasia Gogolek [email protected]