diff --git a/changelogs/fragments/6154-znode-optional-tls.yml b/changelogs/fragments/6154-znode-optional-tls.yml new file mode 100644 index 0000000000..92570d4623 --- /dev/null +++ b/changelogs/fragments/6154-znode-optional-tls.yml @@ -0,0 +1,2 @@ +minor_changes: + - znode module - optional ``use_tls`` parameter added for encrypted communication (https://github.com/ansible-collections/community.general/issues/6154). diff --git a/plugins/modules/znode.py b/plugins/modules/znode.py index 66f11465d6..f5aa54ef89 100644 --- a/plugins/modules/znode.py +++ b/plugins/modules/znode.py @@ -72,6 +72,13 @@ options: type: str required: false version_added: 5.8.0 + use_tls: + description: + - Using TLS/SSL or not. + type: bool + default: false + required: false + version_added: '6.5.0' requirements: - kazoo >= 2.1 - python >= 2.6 @@ -155,6 +162,7 @@ def main(): recursive=dict(default=False, type='bool'), auth_scheme=dict(default='digest', choices=['digest', 'sasl']), auth_credential=dict(type='str', no_log=True), + use_tls=dict(default=False, type='bool'), ), supports_check_mode=False ) @@ -208,7 +216,7 @@ def check_params(params): class KazooCommandProxy(): def __init__(self, module): self.module = module - self.zk = KazooClient(module.params['hosts']) + self.zk = KazooClient(module.params['hosts'], use_ssl=module.params['use_tls']) def absent(self): return self._absent(self.module.params['name'])