Open jamesdehart opened 1 month ago
Hello @jamesdehart,
In general I'd advise against managing objects outside the moudle that creates them. The module provides a "roles" parameter so I'd stick to using that to grant roles. That said the suggested fix is fine provided it doesn't break anything else.
Cheers,
Rnys
SUMMARY
Using the
community.cassandra.cassandra_role
module to create the inital roles. Then in a later step I added some grants to this role. If ansible runs a 2nd time you will getargument of type 'NoneType' is not iterable
.ISSUE TYPE
COMPONENT NAME
community.cassandra.cassandra_role
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
default configs.
OS / ENVIRONMENT
STEPS TO REPRODUCE
Given the following flow (Assuming the default super user is used) everything works the first time.
EXPECTED RESULTS
Not to error out.
ACTUAL RESULTS
The issue happens with the 2nd time running the apply. Seen below:
More details below. You can see
roles
isnull
and that causes issuesI think the issue is here -> https://github.com/ansible-collections/community.cassandra/blob/master/plugins/modules/cassandra_role.py#L437 where there is no null check for roles. I'm not sure if this is expected or not.
Since I'm working on adding support for the cert files to use two way auth I changed:
to
That seems to fix the issue with additional runs.