Parameterize the waiting of AWS power state.
Add a 'aws_instance_wait_for_stop' variable to control the AWS
instance state return.
By default, lifecycle.yml does not wait.
| | |
| | | |
| | | * `ansible-playbook ansible/destroy.yaml -e @/home/myself/myenvironment-variables.yml -e@/home/myself/my_secret.yml` |
| | | |
| | | == Sample Environmet Variables |
| | | == Sample Environment Variables |
| | | |
| | | [source,yaml] |
| | | ---- |
| | |
| | | cloud_provider: ec2 |
| | | cloud_tags: {'Purpose': 'development'} |
| | | aws_region: us-east-2 |
| | | aws_instance_wait_for_stop: true |
| | | cloudformation_retries: 0 |
| | | key_name: ocpkey |
| | | software_to_deploy: none |
| | |
| | | aws_region: us-east-1 |
| | | # The key that is used to |
| | | key_name: "default_key_name" |
| | | # Whether to wait for AWS to return that the instance has stopped |
| | | aws_instance_wait_for_stop: false |
| | | |
| | | ## Networking (AWS) |
| | | subdomain_base_short: "{{ guid }}" |
| | |
| | | when: ACTION == 'stop' |
| | | ec2_instance: |
| | | state: stopped |
| | | wait: no |
| | | wait: {{ aws_instance_wait_for_stop }} |
| | | filters: |
| | | "tag:guid": "{{ guid }}" |
| | | "tag:env_type": "{{ env_type }}" |
| | | instance-state-name: running |
| | | |
| | | - name: Start instances by (guid, env_type) tags |
| | | when: ACTION == 'start' |
| | |
| | | filters: |
| | | "tag:guid": "{{ guid }}" |
| | | "tag:env_type": "{{ env_type }}" |
| | | |
| | | instance-state-name: stopped |
| | | - when: ACTION == 'status' |
| | | block: |
| | | - name: Get EC2 facts using (guid, env_type) tag |