Skip to content

Commit

Permalink
elb_application_lb: enable the functional test
Browse files Browse the repository at this point in the history
Remove the `unsupported` aliases for the `elb_application_lb` test.

Use HTTP instead of HTTPS to avoid the dependency on
`iam:ListServerCertificates` and the other Certificate related operations.
  • Loading branch information
goneri committed Jan 7, 2021
1 parent e088eda commit e22cd3e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 157 deletions.
2 changes: 1 addition & 1 deletion tests/integration/targets/elb_application_lb/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cloud/aws
unsupported
shippable/aws/group2
48 changes: 0 additions & 48 deletions tests/integration/targets/elb_application_lb/tasks/full_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,40 +117,6 @@
vpc_id: '{{ vpc.vpc.id }}'
state: present
register: tg
- name: create privatekey for testing
community.crypto.openssl_privatekey:
path: ./ansible_alb_test.pem
size: 2048
- name: create csr for cert
community.crypto.openssl_csr:
path: ./ansible_alb_test.csr
privatekey_path: ./ansible_alb_test.pem
C: US
ST: AnyPrincipality
L: AnyTown
O: AnsibleIntegrationTest
OU: Test
CN: ansible-alb-test.example.com
- name: create certificate
community.crypto.openssl_certificate:
path: ./ansible_alb_test.crt
privatekey_path: ./ansible_alb_test.pem
csr_path: ./ansible_alb_test.csr
provider: selfsigned
- name: upload server cert to iam
iam_cert:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
security_token: '{{ security_token }}'
region: '{{ aws_region }}'
name: '{{ alb_name }}'
state: present
cert: ./ansible_alb_test.crt
key: ./ansible_alb_test.pem
register: cert_upload
- name: register certificate arn to acm_arn fact
set_fact:
cert_arn: '{{ cert_upload.arn }}'
- include_tasks: test_alb_bad_listener_options.yml
- include_tasks: test_alb_tags.yml
- include_tasks: test_creating_alb.yml
Expand Down Expand Up @@ -189,20 +155,6 @@
until: remove_tg is success
when: tg is defined
ignore_errors: true
- name: destroy acm certificate
iam_cert:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
security_token: '{{ security_token }}'
region: '{{ aws_region }}'
name: '{{ alb_name }}'
state: absent
register: remove_cert
retries: 5
delay: 3
until: remove_cert is success
when: cert_arn is defined
ignore_errors: true
- name: destroy sec group
ec2_group:
aws_access_key: '{{ aws_access_key }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,40 +117,6 @@
vpc_id: '{{ vpc.vpc.id }}'
state: present
register: tg
- name: create privatekey for testing
community.crypto.openssl_privatekey:
path: ./ansible_alb_test.pem
size: 2048
- name: create csr for cert
community.crypto.openssl_csr:
path: ./ansible_alb_test.csr
privatekey_path: ./ansible_alb_test.pem
C: US
ST: AnyPrincipality
L: AnyTown
O: AnsibleIntegrationTest
OU: Test
CN: ansible-alb-test.example.com
- name: create certificate
community.crypto.openssl_certificate:
path: ./ansible_alb_test.crt
privatekey_path: ./ansible_alb_test.pem
csr_path: ./ansible_alb_test.csr
provider: selfsigned
- name: upload server cert to iam
iam_cert:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
security_token: '{{ security_token }}'
region: '{{ aws_region }}'
name: '{{ alb_name }}'
state: present
cert: ./ansible_alb_test.crt
key: ./ansible_alb_test.pem
register: cert_upload
- name: register certificate arn to acm_arn fact
set_fact:
cert_arn: '{{ cert_upload.arn }}'
- include_tasks: test_multiple_actions_fail.yml
always:
- name: destroy ALB
Expand Down Expand Up @@ -183,20 +149,6 @@
until: remove_tg is success
when: tg is defined
ignore_errors: true
- name: destroy acm certificate
iam_cert:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
security_token: '{{ security_token }}'
region: '{{ aws_region }}'
name: '{{ alb_name }}'
state: absent
register: remove_cert
retries: 10
delay: 5
until: remove_cert is success
when: cert_arn is defined
ignore_errors: true
- name: destroy sec group
ec2_group:
aws_access_key: '{{ aws_access_key }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,11 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: redirect
RedirectConfig: "{{ RedirectActionConfig }}"
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
<<: *aws_connection_info
register: alb

Expand All @@ -106,14 +103,11 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: redirect
RedirectConfig: "{{ RedirectActionConfig }}"
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
<<: *aws_connection_info
register: alb

Expand All @@ -131,14 +125,11 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: fixed-response
FixedResponseConfig: "{{ FixedResponseActionConfig }}"
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
<<: *aws_connection_info
register: alb

Expand All @@ -156,14 +147,11 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: fixed-response
FixedResponseConfig: "{{ FixedResponseActionConfig }}"
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
<<: *aws_connection_info
register: alb

Expand All @@ -181,14 +169,11 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: fixed-response
FixedResponseConfig: "{{ FixedResponseActionConfig }}"
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
Rules:
- Conditions:
- Field: path-pattern
Expand Down Expand Up @@ -236,14 +221,11 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: fixed-response
FixedResponseConfig: "{{ FixedResponseActionConfig }}"
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
Rules:
- Conditions:
- Field: path-pattern
Expand Down Expand Up @@ -292,18 +274,15 @@
# security_groups: "{{ sec_group.group_id }}"
# state: present
# listeners:
# - Protocol: HTTPS
# Port: 443
# - Protocol: HTTP
# Port: 80
# DefaultActions:
# - Type: forward
# TargetGroupName: "{{ tg_name }}"
# Order: 2
# - Type: authenticate-oidc
# AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}"
# Order: 1
# Certificates:
# - CertificateArn: "{{ cert_arn }}"
# SslPolicy: ELBSecurityPolicy-2016-08
# <<: *aws_connection_info
# register: alb
#
Expand All @@ -319,18 +298,15 @@
# security_groups: "{{ sec_group.group_id }}"
# state: present
# listeners:
# - Protocol: HTTPS
# Port: 443
# - Protocol: HTTP
# Port: 80
# DefaultActions:
# - Type: authenticate-oidc
# AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}"
# Order: 1
# - Type: forward
# TargetGroupName: "{{ tg_name }}"
# Order: 2
# Certificates:
# - CertificateArn: "{{ cert_arn }}"
# SslPolicy: ELBSecurityPolicy-2016-08
# <<: *aws_connection_info
# register: alb
#
Expand All @@ -347,18 +323,15 @@
# security_groups: "{{ sec_group.group_id }}"
# state: present
# listeners:
# - Protocol: HTTPS
# Port: 443
# - Protocol: HTTP
# Port: 80
# DefaultActions:
# - Type: authenticate-oidc
# AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}"
# Order: 1
# - Type: forward
# TargetGroupName: "{{ tg_name }}"
# Order: 2
# Certificates:
# - CertificateArn: "{{ cert_arn }}"
# SslPolicy: ELBSecurityPolicy-2016-08
# Rules:
# - Conditions:
# - Field: path-pattern
Expand Down Expand Up @@ -389,18 +362,15 @@
# security_groups: "{{ sec_group.group_id }}"
# state: present
# listeners:
# - Protocol: HTTPS
# Port: 443
# - Protocol: HTTP
# Port: 80
# DefaultActions:
# - Type: authenticate-oidc
# AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}"
# Order: 1
# - Type: forward
# TargetGroupName: "{{ tg_name }}"
# Order: 2
# Certificates:
# - CertificateArn: "{{ cert_arn }}"
# SslPolicy: ELBSecurityPolicy-2016-08
# Rules:
# - Conditions:
# - Field: path-pattern
Expand Down Expand Up @@ -431,18 +401,15 @@
# security_groups: "{{ sec_group.group_id }}"
# state: present
# listeners:
# - Protocol: HTTPS
# Port: 443
# - Protocol: HTTP
# Port: 80
# DefaultActions:
# - Type: authenticate-oidc
# AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}"
# Order: 1
# - Type: forward
# TargetGroupName: "{{ tg_name }}"
# Order: 2
# Certificates:
# - CertificateArn: "{{ cert_arn }}"
# SslPolicy: ELBSecurityPolicy-2016-08
# Rules:
# - Conditions:
# - Field: path-pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,15 @@
security_groups: "{{ sec_group.group_id }}"
state: present
listeners:
- Protocol: HTTPS
Port: 443
- Protocol: HTTP
Port: 80
DefaultActions:
- Type: forward
TargetGroupName: "{{ tg_name }}"
Order: 2
- Type: authenticate-oidc
AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}"
Order: 1
Certificates:
- CertificateArn: "{{ cert_arn }}"
SslPolicy: ELBSecurityPolicy-2016-08
<<: *aws_connection_info
register: alb
ignore_errors: yes
Expand Down

0 comments on commit e22cd3e

Please sign in to comment.