Closed imesias closed 2 years ago
Files identified in the description:
plugins/modules/rds_cluster.py
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/plugins/modules/rds_cluster.py)If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @alinabuzachis @jillr @markuman @s-hertel @tremble click here for bot help
@imesias Thank you for raising this issue. Will have a look and let you know.
@alinabuzachis @jillr @markuman @s-hertel @tremble I had a minute to have a quick look at this today. It appears the 'KeyError' is valid. get_cluster
returns the cluster information returned by the describe_db_clusters
boto call, if you have a look at the payload. You'll notice there is no DBClusterParameterGroupName
there is however a DBClusterParameterGroup
.
I noticed the way you tackled this previously was to pop the values off and compare before it reaches https://github.com/ansible-collections/community.aws/blob/main/plugins/modules/rds_cluster.py#L836 which is where the error occurs because the key DBClusterParameterGroupName
doesn't exist in the current_cluster
.
I suspect I could add the following to resolve?
desired_db_cluster_parameter_group = modify_params.pop("DBClusterParameterGroupName", None)
if desired_db_cluster_parameter_group:
if desired_db_cluster_parameter_group != current_cluster["DBClusterParameterGroup"]:
changing_params["DBClusterParameterGroupName"] = desired_db_cluster_parameter_group
If someone could guide me along the contribution process I'd be happy to submit a PR.
@alinabuzachis @jillr @markuman @s-hertel @tremble PR submitted https://github.com/ansible-collections/community.aws/pull/1417
Summary
When I try and create a cluster using
community.aws.rds_cluster
to create an rds cluster. Upon first execution of the playbook the cluster is created. When run again expecting to see 'ok' instead of changed the module fails with an error:Issue Type
Bug Report
Component Name
rds_cluster
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
control node: macOS
Steps to Reproduce
Expected Results
When you execute the play the first time the cluster is created, when you execute it a second time the playbook fails with an error. I expected it to say 'ok' as in the resource exists and is already created. I
Actual Results
I suspect that there is a difference being detected between what is defined and what has just been created in the environment so the code attempts a method with the wrong attributes.
Code of Conduct