Guillaume Coré
2018-09-03 cffbc687bb4dfafff269cf3a50cc89083a800a7f
Fix cloudformation steps: use another register for s3

We cannot use the same register ('cloudformation_out') for both local and s3
method because the latest if skipped, will result in a register 'succeeded'.

Rename the cloudformation-s3 register and overwrite the 'cloudformation_out'
register when used.
1 files modified
10 ■■■■■ changed files
ansible/roles/infra-ec2-template-create/tasks/main.yml 10 ●●●●● patch | view | raw | blame | history
ansible/roles/infra-ec2-template-create/tasks/main.yml
@@ -69,7 +69,7 @@
      tags:
        - aws_infrastructure_deployment
        - provision_cf_template
      register: cloudformation_out
      register: cloudformation_out_s3
      until: >-
        cloudformation_out is succeeded
        or (
@@ -81,6 +81,14 @@
      when: stat_template.stat.size > 51200
      ignore_errors: yes
    # We cannot have the same name for the register because the skipped task is always succeeded.
    # We write back to cloudformation_out if it used the s3 method:
    - name: Set fact cloudformation_out
      set_fact:
        cloudformation_out: "{{ cloudformation_out_s3 }}"
      when:
        - stat_template.stat.size > 51200
    - name: debug cloudformation
      debug:
        var: cloudformation_out