-
Notifications
You must be signed in to change notification settings - Fork 398
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
Fix KeyError when Cluster Parameter Group is specified in rds_cluster.py #1417
Fix KeyError when Cluster Parameter Group is specified in rds_cluster.py #1417
Conversation
DBClusterParameterGroupName
Key Error when comparing state
@imesias thank you for your PR. |
@markuman I've added the changelog fragment and I guess the below should be a sufficient test, problem is there is no db cluster parameter group in the collection to create a cluster parameter group. I could use the cli as a workaround. Please let me know if that will work. #... some task before to create the parameter group ...
- name: Modify DB cluster parameter group
rds_cluster:
id: "{{ cluster_id }}"
state: present
db_cluster_parameter_group_name: "{{ new_db_parameter_group_name }}"
register: _result_modify_db_parameter_group_name
- assert:
that:
- _result_modify_db_parameter_group_name.changed
- "'allocated_storage' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.allocated_storage == 1
- "'cluster_create_time' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.copy_tags_to_snapshot == false
- "'db_cluster_arn' in _result_modify_db_parameter_group_name"
- "_result_modify_db_parameter_group_name.db_cluster_identifier == '{{ cluster_id }}'"
- "'db_cluster_parameter_group' in _result_modify_db_parameter_group_name"
- "'db_cluster_resource_id' in _result_modify_db_parameter_group_name"
- "'endpoint' in _result_modify_db_parameter_group_name"
- "'engine' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.engine == "{{ engine }}"
- "'engine_mode' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.engine_mode == "provisioned"
- "'engine_version' in _result_modify_db_parameter_group_name"
- "'master_username' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.master_username == "{{ username }}"
- "'port' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.db_cluster_parameter_group == "{{ new_db_parameter_group_name }}"
- "'status' in _result_modify_db_parameter_group_name"
- _result_modify_db_parameter_group_name.status == "available"
- "'tags' in _result_modify_db_parameter_group_name"
- "'vpc_security_groups' in _result_modify_db_parameter_group_name" |
@imesias hm, thereretically yes. like https://github.com/ansible-collections/amazon.aws/blob/ad7a0eb22a3e108451959eceff4f1bd78ea8be7c/tests/integration/targets/ec2_instance/roles/ec2_instance/tasks/termination_protection.yml#L47-L54 |
@markuman @alinabuzachis Expanded integration tests for parameter group test case. Uses cli to create the parameter group and a cleanup task added as well. |
Agree. If I find some time I’ll work on adding this new module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imesias thank you for working on this. LGTM!
@markuman @alinabuzachis hmmm, Seems there are 3 issues.
I will have a look at resolving the first two, not sure who I can talk to about the number 3. Thanks! |
Hey @markuman @alinabuzachis, The CI AWS credentials require permission to create and remove a Kind Regards, |
fbc1118
to
c5b0a70
Compare
@gravesm Thanks for the assist and update. Much appreciated. @alinabuzachis @markuman integ tests are now passing. |
Backport to stable-3: 💚 backport PR created✅ Backport PR branch: Backported as #1432 🤖 @patchback |
….py (#1417) Fix KeyError when Cluster Parameter Group is specified in rds_cluster.py SUMMARY Fix KeyError when comparing state. Fixes: #1409 ISSUE TYPE Bugfix Pull Request COMPONENT NAME rds_cluster.py Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]> (cherry picked from commit b3bc689)
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #1433 🤖 @patchback |
….py (#1417) Fix KeyError when Cluster Parameter Group is specified in rds_cluster.py SUMMARY Fix KeyError when comparing state. Fixes: #1409 ISSUE TYPE Bugfix Pull Request COMPONENT NAME rds_cluster.py Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]> (cherry picked from commit b3bc689)
….py (#1417) (#1433) [PR #1417/b3bc6893 backport][stable-4] Fix KeyError when Cluster Parameter Group is specified in rds_cluster.py This is a backport of PR #1417 as merged into main (b3bc689). SUMMARY Fix KeyError when comparing state. Fixes: #1409 ISSUE TYPE Bugfix Pull Request COMPONENT NAME rds_cluster.py Reviewed-by: Mark Chappell <None>
….py (ansible-collections#1417) Fix KeyError when Cluster Parameter Group is specified in rds_cluster.py SUMMARY Fix KeyError when comparing state. Fixes: ansible-collections#1409 ISSUE TYPE Bugfix Pull Request COMPONENT NAME rds_cluster.py 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@b3bc689
SUMMARY
Fix KeyError when comparing state.
Fixes: #1409
ISSUE TYPE
COMPONENT NAME
rds_cluster.py