| | |
| | | - step002 |
| | | - post_infrastructure |
| | | tasks: |
| | | - debug: |
| | | msg: "Step 002 Post Infrastructure - Dummy action" |
| | | - name: get Route53User credentials from stack outputs |
| | | set_fact: |
| | | route53user: "{{ cloudformation_out_final.stack_outputs.Route53User }}" |
| | | route53user_access_key: "{{ cloudformation_out_final.stack_outputs.Route53UserAccessKey }}" |
| | | route53user_secret_access_key: "{{ cloudformation_out_final.stack_outputs.Route53UserSecretAccessKey }}" |
| | | when: |
| | | - cloudformation_out_final is defined |
| | | - cloudformation_out_final.stack_outputs.Route53UserAccessKey is defined |
| | | - cloudformation_out_final.stack_outputs.Route53UserSecretAccessKey is defined |
| | | tags: |
| | | - provision_cf_template |
| | | |
| | | - name: Step 002 Post Infrastructure clientvm |
| | | hosts: clientvms |
| | | become: false |
| | | tags: |
| | | - step002 |
| | | - post_infrastructure |
| | | tasks: |
| | | - name: Create .aws for awscli |
| | | file: |
| | | path: ~/.aws |
| | | mode: 0700 |
| | | state: directory |
| | | |
| | | - name: Write down Route53User credentials |
| | | blockinfile: |
| | | dest: "~/.aws/credentials" |
| | | create: yes |
| | | content: | |
| | | [route53] |
| | | # {{ hostvars.localhost.route53user }} |
| | | aws_access_key_id={{ hostvars.localhost.route53user_access_key }} |
| | | aws_secret_access_key={{ hostvars.localhost.route53user_secret_access_key }} |
| | | when: hostvars.localhost.route53user_access_key is defined |