ansible-collections / community.cassandra

Cassandra Ansible Collection
http://galaxy.ansible.com/community/cassandra
GNU General Public License v3.0
26 stars 19 forks source link

Universal field names for login_user vs user #129

Closed tlb1galaxy closed 3 years ago

tlb1galaxy commented 3 years ago
SUMMARY

All module fields related to login (creds to access the underlying module/commands) should be the same name.

ISSUE TYPE

But currently you would have to set multiple

COMPONENT NAME

cassandra_cqlsh cassandra_role cassandra_status

ADDITIONAL INFORMATION
rhysmeister commented 3 years ago

Yes I was aware of this. At least some of the inconsistency is due to the fact I decided to align with the underlying tool (nodetool or cqlsh) and conventions copied from the community.mongodb modules. But I agree it would be better to align them. This should work by setting an alias... https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec

files using the common args spec

grep cassandra_common_argument_spec -l plugins/modules/*.py plugins/modules/cassandra_autocompaction.py plugins/modules/cassandra_backup.py plugins/modules/cassandra_binary.py plugins/modules/cassandra_cleanup.py plugins/modules/cassandra_compactionthreshold.py plugins/modules/cassandra_compactionthroughput.py plugins/modules/cassandra_drain.py plugins/modules/cassandra_flush.py plugins/modules/cassandra_gossip.py plugins/modules/cassandra_handoff.py plugins/modules/cassandra_interdcstreamthroughput.py plugins/modules/cassandra_schema.py plugins/modules/cassandra_status.py plugins/modules/cassandra_stopdaemon.py plugins/modules/cassandra_streamthroughput.py plugins/modules/cassandra_thrift.py plugins/modules/cassandra_traceprobability.py plugins/modules/cassandra_upgradesstables.py plugins/modules/cassandra_verify.py

modules not using the common arg spec

grep cassandra_common_argument_spec -L plugins/modules/*.py plugins/modules/cassandra_cqlsh.py plugins/modules/cassandra_keyspace.py plugins/modules/cassandra_role.py plugins/modules/cassandra_table.py

Proposal to align…

Then all modules would have the login_* parameters as an option.

tlb1galaxy commented 3 years ago

Hello Rhys, I figured it was due to the fact it was aligned with the underlying tools. Hopefully the Cassandra developers in the near future can align their tools too. Thanks

From: Rhys notifications@github.com Sent: February 23, 2021 2:55 PM To: ansible-collections/community.cassandra community.cassandra@noreply.github.com Cc: tlb1_galaxy tlb1_galaxy@thinkon.com; Author author@noreply.github.com Subject: Re: [ansible-collections/community.cassandra] Universal field names for login_user vs user (#129)

CAUTION - EXTERNAL EMAIL This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe


Yes I was aware of this. At least some of the inconsistency is due to the fact I decided to align with the underlying tool (nodetool or cqlsh) and conventions copied from the community.mongodb modules. But I agree it would be better to align them. This should work by setting an alias... https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec

files using the common args spec

grep cassandra_common_argument_spec -l plugins/modules/*.py plugins/modules/cassandra_autocompaction.py plugins/modules/cassandra_backup.py plugins/modules/cassandra_binary.py plugins/modules/cassandra_cleanup.py plugins/modules/cassandra_compactionthreshold.py plugins/modules/cassandra_compactionthroughput.py plugins/modules/cassandra_drain.py plugins/modules/cassandra_flush.py plugins/modules/cassandra_gossip.py plugins/modules/cassandra_handoff.py plugins/modules/cassandra_interdcstreamthroughput.py plugins/modules/cassandra_schema.py plugins/modules/cassandra_status.py plugins/modules/cassandra_stopdaemon.py plugins/modules/cassandra_streamthroughput.py plugins/modules/cassandra_thrift.py plugins/modules/cassandra_traceprobability.py plugins/modules/cassandra_upgradesstables.py plugins/modules/cassandra_verify.py

modules not using the common arg spec

grep cassandra_common_argument_spec -L plugins/modules/*.py plugins/modules/cassandra_cqlsh.py plugins/modules/cassandra_keyspace.py plugins/modules/cassandra_role.py plugins/modules/cassandra_table.py

Proposal to align…

Then all modules would have the login_* parameters as an option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ansible-collections/community.cassandra/issues/129#issuecomment-784469380, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASODCRXWORBHHAHQZFQQMPLTAQBZDANCNFSM4YC4P4EA.

rhysmeister commented 3 years ago

I've just merged a change that implements the login_* options across all modules. Added a few tests and seems to work.

Cheers,

Rhys