| | |
| | | shell: "jq -c . < {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template-orig > {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" |
| | | register: jq_minify |
| | | ignore_errors: true |
| | | tags: |
| | | - aws_infrastructure_deployment |
| | | - gen_cf_template |
| | | - minify_cf_template |
| | | |
| | | - name: use original if jq failed |
| | | command: "cp {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template-orig {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" |
| | | when: jq_minify|failed |
| | | tags: |
| | | - aws_infrastructure_deployment |
| | | - gen_cf_template |
| | | - minify_cf_template |
| | | |
| | | ######################### Validate CF Template |
| | | |
| | |
| | | AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" |
| | | AWS_DEFAULT_REGION: "{{aws_region}}" |
| | | shell: "aws cloudformation validate-template --region {{ aws_region | default(region) | default('us-east-1')}} --template-body file://{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" |
| | | tags: |
| | | - aws_infrastructure_deployment |
| | | - validate_cf_template |
| | | |
| | | ######################### Launch CF Template |
| | | |
| | |
| | | tags: |
| | | - create_inventory |
| | | - must |
| | | |
| | | - name: windows ostype workaround |
| | | set_fact: |
| | | project_tag_ostype: "{{project_tag}}_ostype" |
| | | tags: |
| | | - create_inventory |
| | | - must |
| | | |
| | | - add_host: |
| | | name: "{{item['public_dns_name']}}" |
| | | shortname: "{{item['tags']['Name'] | default(item['private_dns_name'])}}" |