Last active
February 21, 2018 18:56
-
-
Save anryko/c854ec431a1b25667da4f1c24a1a23e4 to your computer and use it in GitHub Desktop.
Revisions
-
anryko revised this gist
Feb 20, 2018 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,14 +9,14 @@ - Protocol: HTTP # Port: 80 DefaultActions: - Type: forward # Required. Only 'forward' is accepted at this time TargetGroupName: se1-stg-webapp-all-alb-http # Required. The name of the target group - Protocol: HTTPS # Port: 443 # SslPolicy: ELBSecurityPolicy-2016-08 Certificates: - CertificateArn: aaa - CertificateArn: bbb listener_http_default: Port: 80 -
anryko revised this gist
Feb 20, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,8 @@ - set_fact: first_certificate: Certificates: - "{{ old_certificates[0] }}" - set_fact: new_listeners: "{{ new_listeners + [ listener_https_default | combine(listener) | combine(first_certificate) ] }}" -
anryko revised this gist
Feb 20, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ - set_fact: first_certificate: - Certificates: "{{ old_certificates[0] }}" - set_fact: new_listeners: "{{ new_listeners + [ listener_https_default | combine(listener) | combine(first_certificate) ] }}" -
anryko revised this gist
Feb 20, 2018 . 2 changed files with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,13 +7,13 @@ vars: listeners: - Protocol: HTTP # Port: 80 DefaultActions: - Type: forward # Required. Only 'forward' is accepted at this time TargetGroupName: "se1-stg-webapp-all-alb-http" # Required. The name of the target group - Protocol: HTTPS # Port: 443 # SslPolicy: ELBSecurityPolicy-2016-08 Certificates: - CertificateArn: 'aaa' - CertificateArn: 'bbb' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ - set_fact: new_listeners: "{{ new_listeners + [ listener_http_default | combine(listener) ] }}" when: listener.Protocol == 'HTTP' - block: @@ -11,5 +11,5 @@ Certificates: "{{ old_certificates[0] }}" - set_fact: new_listeners: "{{ new_listeners + [ listener_https_default | combine(listener) | combine(first_certificate) ] }}" when: listener.Protocol == 'HTTPS' -
anryko created this gist
Feb 20, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ --- - name: test hosts: localhost connection: local gather_facts: False vars: listeners: - Protocol: HTTP Port: 80 DefaultActions: - Type: forward # Required. Only 'forward' is accepted at this time TargetGroupName: "se1-stg-webapp-all-alb-http" # Required. The name of the target group - Protocol: HTTPS Port: 443 SslPolicy: ELBSecurityPolicy-2016-08 Certificates: - CertificateArn: 'aaa' - CertificateArn: 'bbb' listener_http_default: Port: 80 listener_https_default: Port: 443 SslPolicy: ELBSecurityPolicy-2016-08 Certificates: [] new_listeners: [] pre_tasks: - include_tasks: listeners_loop.yml loop_control: loop_var: listener with_items: "{{ listeners }}" - debug: var: new_listeners This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ - set_fact: new_listeners: "{{ new_listeners + [ listener | combine(listener_http_default) ] }}" when: listener.Protocol == 'HTTP' - block: - set_fact: old_certificates: "{{ listener.Certificates }}" - set_fact: first_certificate: Certificates: "{{ old_certificates[0] }}" - set_fact: new_listeners: "{{ new_listeners + [ listener | combine(listener_https_default) | combine(first_certificate) ] }}" when: listener.Protocol == 'HTTPS'