Closed Andersson007 closed 6 months ago
I think @oraNod would take a look
@oraNod what did @aleksvagachev in the clickhouse_user pr is very similar to what i wrote here. FYI
@Andersson007 Hey, sorry for the delay in replying but I'll start working on this next week and will let you know if any questions come up. Cheers!
@Andersson007 Hey, sorry for the delay in replying but I'll start working on this next week and will let you know if any questions come up. Cheers!
@oraNod sure, no worries!
SUMMARY
clickhouse_role: create MVP for the module
To accomplish this, I would follow the following algorithm:
/test/integration/targets/clickhouse_db
directory to/test/integration/targets/clickhouse_role
./tasks/initial.yml
in that directory with something like- meta: end_play
for now as there's nothing to testansible-test integration clickhouse_role --docker ubuntu2204 -vvv
, they should passplugins/modules/clickhouse_db.py
toplugins/modules/clickhouse_role.py
state: present|absent
andname: rolename
. Update the DOCUMENTATION and EXAMPLES section correspondingly.CREATE ROLE <rolename>
(when the state is present and the role does not exist) andDROP ROLE <rolename>
(when the state is absent and the role exists). To figure out whether the role exists or not query the system.roles table withSELECT 1 (or name if it doesn't work) FROM system.roles WHERE name = '<rolename>'
and check the result.ansible-tests sanity plugins/modules/clickhouse_role.py --docker
: it'll help you catch some code syntax errors besides sanity errors- meta: end_play
with a real test in tests/integration/targets/clickhouse_role/tasks/initial.yml with a module invocation similarly as in the same file but for clickhouse_db target.If you got any questions along the way, just ask