-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elb_application_lb: unable to use authenticate-oidc #1877
Comments
…type=authenticate-oidc ansible-collections#1877
@markuman I can't reproduce the issue when modifying the existing load balancer rule.
However this has been fixed using #1956 Could you please provide a full sequence on how to reproduce the issue ? - name: Create an ALB with different listener by adding rule
amazon.aws.elb_application_lb:
name: sample-lb
subnets:
- subnet-xxxxxxxxxxxxxxxxx
- subnet-xxxxxxxxxxxxxxxxx
security_groups: sg-xxxxxxxxxxxxxx
state: present
listeners:
- Protocol: HTTPS
Port: 443
Certificates:
- CertificateArn: arn:aws:iam::0123456789:server-certificate/ansible-test-xxxxxxxxxxx
SslPolicy: ELBSecurityPolicy-TLS13-1-2-2021-06
DefaultActions:
- Type: forward
TargetGroupName: test-target-01
Rules:
- Priority: 1
Conditions:
- Field: path-pattern
Values:
- /test
Actions:
- TargetGroupName: test-target-01
Type: forward
Order: 2
- Type: authenticate-oidc
Order: 1
AuthenticateOidcConfig:
Issuer: https://xxxxxxxxxxx
AuthorizationEndpoint: https://xxxxxxxxxxxxxx
TokenEndpoint: https://xxxxxxxxxxxxxx/oauth/token
UserInfoEndpoint: https://xxxxxxxxxxxxx/userinfo
ClientId: myclientid123645
ClientSecret: abcdefghigjth1233
UseExistingClientSecret: True |
This comment was marked as outdated.
This comment was marked as outdated.
Okey, the issue is a kind different. The rule was detected as a modified rule, but it was a new one. This case is not solveable! But when the rule is added at the end of the rules list, it becomes a new rule (priority that does not exist yet), the module runs into a hen-egg problem.
When
then |
So to reproduce it you need to first apply this - name: Create an ALB with different listener by adding rule
amazon.aws.elb_application_lb:
name: sample-lb
subnets:
- subnet-xxxxxxxxxxxxxxxxx
- subnet-xxxxxxxxxxxxxxxxx
security_groups: sg-xxxxxxxxxxxxxx
state: present
listeners:
- Protocol: HTTPS
Port: 443
Certificates:
- CertificateArn: arn:aws:iam::0123456789:server-certificate/ansible-test-xxxxxxxxxxx
SslPolicy: ELBSecurityPolicy-TLS13-1-2-2021-06
DefaultActions:
- Type: forward
TargetGroupName: test-target-01
Rules:
- Priority: 1
Conditions:
- Field: host-header
Values:
- bla.tld
Actions:
- TargetGroupName: somewhere
Type: forward
- Priority: 2
Conditions:
- Field: host-header
Values:
- yolo.rocks
Actions:
- TargetGroupName: yeah
Type: forward and then modify it like that - name: Create an ALB with different listener by adding rule
amazon.aws.elb_application_lb:
name: sample-lb
subnets:
- subnet-xxxxxxxxxxxxxxxxx
- subnet-xxxxxxxxxxxxxxxxx
security_groups: sg-xxxxxxxxxxxxxx
state: present
listeners:
- Protocol: HTTPS
Port: 443
Certificates:
- CertificateArn: arn:aws:iam::0123456789:server-certificate/ansible-test-xxxxxxxxxxx
SslPolicy: ELBSecurityPolicy-TLS13-1-2-2021-06
DefaultActions:
- Type: forward
TargetGroupName: test-target-01
Rules:
- Priority: 1
Conditions:
- Field: host-header
Values:
- bla.tld
Actions:
- TargetGroupName: somewhere
Type: forward
- Priority: 2
Conditions:
- Field: path-pattern
Values:
- /test
Actions:
- TargetGroupName: test-target-01
Type: forward
Order: 2
- Type: authenticate-oidc
Order: 1
AuthenticateOidcConfig:
Issuer: https://xxxxxxxxxxx
AuthorizationEndpoint: https://xxxxxxxxxxxxxx
TokenEndpoint: https://xxxxxxxxxxxxxx/oauth/token
UserInfoEndpoint: https://xxxxxxxxxxxxx/userinfo
ClientId: myclientid123645
ClientSecret: abcdefghigjth1233
UseExistingClientSecret: True
- Priority: 3
Conditions:
- Field: host-header
Values:
- yolo.rocks
Actions:
- TargetGroupName: yeah
Type: forward |
…type=authenticate-oidc ansible-collections#1877
…type=authenticate-oidc ansible-collections#1877
…type=authenticate-oidc ansible-collections#1877
…type=authenticate-oidc ansible-collections#1877
No, it does not solve the issue. |
this still failed with your branch, when adding a new rule to existing ALB at the end (priority number + 1). |
…type=authenticate-oidc ansible-collections#1877
@markuman I just realized that there is an API to update the Rule priority, this will be used when the rule has just changed the priority but all the other properties remain the same. This will fix the use case where an
This has also been fixed. |
…type=authenticate-oidc ansible-collections#1877
…1956) module_utils/elbv2 - fix issue with authenticate-oidc listener rule SUMMARY fixes #1877 The module now detect rule which changing priority, they are no more considered as new rules but we are using the set_rule_priorities API instead to update the priority. For authenticated-oidc rule, we set always set the UseExistingSecret to False for new rule to create and when the rule need to be modified and the user has provided a ClientSecret. ISSUE TYPE Bugfix Pull Request Reviewed-by: Helen Bailey <[email protected]> Reviewed-by: Bikouo Aubin Reviewed-by: Alina Buzachis
…1956) module_utils/elbv2 - fix issue with authenticate-oidc listener rule SUMMARY fixes #1877 The module now detect rule which changing priority, they are no more considered as new rules but we are using the set_rule_priorities API instead to update the priority. For authenticated-oidc rule, we set always set the UseExistingSecret to False for new rule to create and when the rule need to be modified and the user has provided a ClientSecret. ISSUE TYPE Bugfix Pull Request Reviewed-by: Helen Bailey <[email protected]> Reviewed-by: Bikouo Aubin Reviewed-by: Alina Buzachis (cherry picked from commit 470ca0a)
…1956) (#2008) [PR #1956/470ca0a0 backport][stable-7] module_utils/elbv2 - fix issue with authenticate-oidc listener rule This is a backport of PR #1956 as merged into main (470ca0a). SUMMARY fixes #1877 The module now detect rule which changing priority, they are no more considered as new rules but we are using the set_rule_priorities API instead to update the priority. For authenticated-oidc rule, we set always set the UseExistingSecret to False for new rule to create and when the rule need to be modified and the user has provided a ClientSecret. ISSUE TYPE Bugfix Pull Request Reviewed-by: Alina Buzachis Reviewed-by: Bikouo Aubin
This issue need to be reopened @abikouo, because it still failed with 7.5.0 the other way round. --- /tmp/before.yml 2024-05-03 08:29:41.697584862 +0200
+++ /tmp/after.yml 2024-05-03 08:29:57.211759937 +0200
@@ -24,25 +24,6 @@
Actions:
- TargetGroupName: somewhere
Type: forward
- - Priority: 2
- Conditions:
- - Field: path-pattern
- Values:
- - /test
- Actions:
- - TargetGroupName: test-target-01
- Type: forward
- Order: 2
- - Type: authenticate-oidc
- Order: 1
- AuthenticateOidcConfig:
- Issuer: https://xxxxxxxxxxx
- AuthorizationEndpoint: https://xxxxxxxxxxxxxx
- TokenEndpoint: https://xxxxxxxxxxxxxx/oauth/token
- UserInfoEndpoint: https://xxxxxxxxxxxxx/userinfo
- ClientId: myclientid123645
- ClientSecret: abcdefghigjth1233
- UseExistingClientSecret: True
- Priority: 3
Conditions:
- Field: host-header
|
…ctions#1877) Add transit-gateway-id parameter to ec2_vpc_vpn module SUMMARY This PR adds transit_gateway_id parameter to ec2_vpc_vpn module. It is needed for the validated content role that manages the creation of transit gateway and attaches VPN to the created transit gateway. ISSUE TYPE Feature Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: Alina Buzachis Reviewed-by: GomathiselviS Reviewed-by: Mark Chappell This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@d74c698
…ctions#1877) Add transit-gateway-id parameter to ec2_vpc_vpn module SUMMARY This PR adds transit_gateway_id parameter to ec2_vpc_vpn module. It is needed for the validated content role that manages the creation of transit gateway and attaches VPN to the created transit gateway. ISSUE TYPE Feature Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: Alina Buzachis Reviewed-by: GomathiselviS Reviewed-by: Mark Chappell This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@d74c698
…ctions#1877) Add transit-gateway-id parameter to ec2_vpc_vpn module SUMMARY This PR adds transit_gateway_id parameter to ec2_vpc_vpn module. It is needed for the validated content role that manages the creation of transit gateway and attaches VPN to the created transit gateway. ISSUE TYPE Feature Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: Alina Buzachis Reviewed-by: GomathiselviS Reviewed-by: Mark Chappell This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@d74c698
…ctions#1877) Add transit-gateway-id parameter to ec2_vpc_vpn module SUMMARY This PR adds transit_gateway_id parameter to ec2_vpc_vpn module. It is needed for the validated content role that manages the creation of transit gateway and attaches VPN to the created transit gateway. ISSUE TYPE Feature Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: Alina Buzachis Reviewed-by: GomathiselviS Reviewed-by: Mark Chappell This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@d74c698
Summary
In the past, you can set as rule
and it worked. Because of this logic, it doesn't matter if the rule is a new one or an existing one.
Currently you get back the error from the past:
once, fixed in #1270
When removing the
ClientSecret
keyit comes to a new error
So something new has changed/gets broken ....
Issue Type
Bug Report
Component Name
elb_application_lb
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Ubuntu 22.04
Steps to Reproduce
see in summary
Expected Results
rules are set, doens't matter if both keys
UseExistingClientSecret: True
andClientSecret
are setActual Results
see summary
Code of Conduct
The text was updated successfully, but these errors were encountered: