From 8fd89721cd30d5891b3ce8737fed537d0ea92251 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 07:29:48 +0100 Subject: [PATCH] [PR #6154/1dd86bcb backport][stable-6] add optional use_tls parameter (#6191) add optional use_tls parameter (#6154) * add optional use_tls parameter * add optional use_tls parameter --------- Co-authored-by: Martin Helwig (cherry picked from commit 1dd86bcb553bb99332940876be7041176ec25431) Co-authored-by: Martin Helwig <115872657+MartinHelwig@users.noreply.github.com> --- 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'])