Skip to content

Commit

Permalink
Added no_log=False for type/update password (#54)
Browse files Browse the repository at this point in the history
* Added no_log=False for type/update password

* Fixed integration tests
  • Loading branch information
aleksvagachev authored Mar 13, 2024
1 parent 2de9836 commit f90377d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions plugins/modules/clickhouse_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ def main():
state=dict(type='str', choices=['present', 'absent'], default='present'),
name=dict(type='str', required=True),
password=dict(type='str', default=None, no_log=True),
type_password=dict(type='str', default='sha256_password', no_log=True),
type_password=dict(type='str', default='sha256_password', no_log=False),
cluster=dict(type='str', default=None),
update_password=dict(type='str', choices=['always', 'on_create'], default='on_create'),
update_password=dict(
type='str', choices=['always', 'on_create'],
default='on_create', no_log=False
),
)

# Instantiate an object of module class
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/clickhouse_user/tasks/initial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ansible.builtin.assert:
that:
- result is changed
- result.executed_statements == ["CREATE USER test_user IDENTIFIED WITH ******** BY '********'"]
- result.executed_statements == ["CREATE USER test_user IDENTIFIED WITH sha256_password BY '********'"]

- name: Test 1 - Check the actual state
register: result
Expand Down Expand Up @@ -118,7 +118,7 @@
ansible.builtin.assert:
that:
- result is changed
- result.executed_statements == ["ALTER USER test_user IDENTIFIED WITH ******** BY '********'"]
- result.executed_statements == ["ALTER USER test_user IDENTIFIED WITH sha256_password BY '********'"]

- name: Drop test_user
community.clickhouse.clickhouse_user:
Expand Down

0 comments on commit f90377d

Please sign in to comment.