From 1dd86bcb553bb99332940876be7041176ec25431 Mon Sep 17 00:00:00 2001 From: Martin Helwig <115872657+MartinHelwig@users.noreply.github.com> Date: Tue, 14 Mar 2023 23:01:59 +0100 Subject: [PATCH] add optional use_tls parameter (#6154) * add optional use_tls parameter * add optional use_tls parameter --------- Co-authored-by: Martin Helwig --- changelogs/fragments/6154-znode-optional-tls.yml | 2 ++ plugins/modules/znode.py | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6154-znode-optional-tls.yml 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'])