Skip to content
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

rds_instance - Broken check_mode and idempotence #1013

Closed
1 task done
jatorcasso opened this issue Mar 24, 2022 · 3 comments · Fixed by #1002
Closed
1 task done

rds_instance - Broken check_mode and idempotence #1013

jatorcasso opened this issue Mar 24, 2022 · 3 comments · Fixed by #1002
Assignees
Labels
bug This issue/PR relates to a bug has_pr module module needs_triage plugins plugin (any type)

Comments

@jatorcasso
Copy link
Contributor

jatorcasso commented Mar 24, 2022

Summary

When adding integration tests for adding iam_roles support for rds_instance, I noticed check_mode tests fail on idempotence checks, as well as some other checks like adding sgs on check_mode, etc.

Issue Type

Bug Report

Component Name

rds_instance

Ansible Version

$ ansible --version

Collection Versions

$ ansible-galaxy collection list

AWS SDK versions

$ pip show boto boto3 botocore

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

    - name: Create DB instance with IAM roles (idempotence) - check_mode
      rds_instance:
        id: "{{ instance_id }}"
        state: present
        engine: postgres
        engine_version: "{{ postgres_db_engine_version }}"
        username: "{{ username }}"
        password: "{{ password }}"
        db_instance_class: "{{ postgres_db_instance_class }}"
        allocated_storage: "{{ allocated_storage }}"
        allow_major_version_upgrade: yes
        iam_roles:
          - role_arn: "{{ s3_integration_role_1.arn }}"
            feature_name: 's3Export'
          - role_arn: "{{ s3_integration_role_2.arn }}"
            feature_name: 'Lambda'
          - role_arn: "{{ s3_integration_role_3.arn }}"
            feature_name: 's3Import'
      register: result
      check_mode: yes

    - assert:
        that:
          - not result.changed

Expected Results

expected check_mode to not modify anything and return the correct changed

Actual Results

in idempotence tests, check_mode returned changed = True. When adding sg on check_mode, the sgs were actually added.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) labels Mar 24, 2022
@jatorcasso
Copy link
Contributor Author

@markuman @alinabuzachis I found the issue to be with the allow_major_version_upgrade parameter. I now see that it's never returned by describe_db_instance, so I guess idempotency wont hold in this case. same with the master_user_password it seems.

@jatorcasso jatorcasso changed the title rds_instance - Broken check_mode rds_instance - Broken check_mode and idempotence Mar 29, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this issue Apr 12, 2022
…/removing iam roles (#1002)

rds_instance - fix check_mode and idempotence bugs and support adding/removing iam roles

SUMMARY

Support the addition and deletion of iam roles to db instances
Fixes #464
Fixes #1013
Integration tests to test both this and the amazon.aws module_util rds changes

Depends-On ansible-collections/amazon.aws#714
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
Wasn't sure the best way to go about deleting IAM roles - ended up using a purge_iam_roles param that defaults to False, which seems consistent with other modules I've looked at.

Reviewed-by: Mark Woolley <[email protected]>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>
patchback bot pushed a commit that referenced this issue Apr 12, 2022
…/removing iam roles (#1002)

rds_instance - fix check_mode and idempotence bugs and support adding/removing iam roles

SUMMARY

Support the addition and deletion of iam roles to db instances
Fixes #464
Fixes #1013
Integration tests to test both this and the amazon.aws module_util rds changes

Depends-On ansible-collections/amazon.aws#714
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
Wasn't sure the best way to go about deleting IAM roles - ended up using a purge_iam_roles param that defaults to False, which seems consistent with other modules I've looked at.

Reviewed-by: Mark Woolley <[email protected]>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>
(cherry picked from commit c403552)
softwarefactory-project-zuul bot pushed a commit that referenced this issue Apr 16, 2022
…/removing iam roles (#1002) (#1055)

[PR #1002/c403552f backport][stable-3] rds_instance - fix check_mode and idempotence bugs and support adding/removing iam roles

This is a backport of PR #1002 as merged into main (c403552).
SUMMARY

Support the addition and deletion of iam roles to db instances
Fixes #464
Fixes #1013
Integration tests to test both this and the amazon.aws module_util rds changes

Depends-On ansible-collections/amazon.aws#714
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
Wasn't sure the best way to go about deleting IAM roles - ended up using a purge_iam_roles param that defaults to False, which seems consistent with other modules I've looked at.

Reviewed-by: Mark Chappell <None>
Reviewed-by: Markus Bergholz <[email protected]>
abikouo pushed a commit to abikouo/community.aws that referenced this issue Oct 24, 2023
…/removing iam roles (ansible-collections#1002)

rds_instance - fix check_mode and idempotence bugs and support adding/removing iam roles

SUMMARY

Support the addition and deletion of iam roles to db instances
Fixes ansible-collections#464
Fixes ansible-collections#1013
Integration tests to test both this and the amazon.aws module_util rds changes

Depends-On ansible-collections/amazon.aws#714
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
Wasn't sure the best way to go about deleting IAM roles - ended up using a purge_iam_roles param that defaults to False, which seems consistent with other modules I've looked at.

Reviewed-by: Mark Woolley <[email protected]>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@c403552
abikouo pushed a commit to abikouo/community.aws that referenced this issue Oct 24, 2023
…nsible-collections#1014)

Add Param to to s3_object module to enforce SigV4 for get operations

SUMMARY
This pull request adds a parameter to the s3_object module that enables users to force/require the Boto SDK to use SigV4 for get operations.
Fixes ansible-collections#1013
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
s3_object
ADDITIONAL INFORMATION
N/A

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Joe Zollo <None>
Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Geoffrey Hichborn <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module needs_triage plugins plugin (any type)
Projects
None yet
2 participants