From 0656ee894a47868c256c6c41a26a89643c3699fb Mon Sep 17 00:00:00 2001 From: reflop <30730390+reflop@users.noreply.github.com> Date: Thu, 23 Jul 2020 18:19:01 +0200 Subject: [PATCH 1/4] Add var for obfuscate= and obfuscate_hostname= for insights config file --- action_plugins/insights_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/action_plugins/insights_config.py b/action_plugins/insights_config.py index 3d53870..426fc64 100644 --- a/action_plugins/insights_config.py +++ b/action_plugins/insights_config.py @@ -18,7 +18,9 @@ def run(self, tmp=None, task_vars=None): auto_config = self._task.args.get('auto_config', None), authmethod = self._task.args.get('authmethod', None), display_name = self._task.args.get('display_name', None), - proxy = self._task.args.get('proxy', None) + proxy = self._task.args.get('proxy', None), + obfuscate = str(self._task.args.get('obfuscate', None)), + obfuscate_hostname = str(self._task.args.get('obfuscate_hostname', None)) ) for k, v in config_vars.items(): From a000d9867ba8c404167d8b1fa35739bede83ebf6 Mon Sep 17 00:00:00 2001 From: reflop <30730390+reflop@users.noreply.github.com> Date: Thu, 23 Jul 2020 18:20:43 +0200 Subject: [PATCH 2/4] Add var for obfuscate= and obfuscate_hostname= for insights config file --- tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 8f33834..b001048 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,6 +27,8 @@ authmethod: "{{ authmethod | default(omit) }}" display_name: "{{ insights_display_name | default(omit) }}" proxy: "{{ insights_proxy | default(omit) }}" + obfuscate: "{{ insights_obfuscate | default(omit) }}" + obfuscate_hostname: "{{ insights_obfuscate_hostname | default(omit) }}" become: true - name: Register Insights Client From c6cda12e3a68f390a13473d18d7e0aa592a2f4a0 Mon Sep 17 00:00:00 2001 From: reflop <30730390+reflop@users.noreply.github.com> Date: Thu, 23 Jul 2020 18:27:21 +0200 Subject: [PATCH 3/4] Add var for obfuscate= and obfuscate_hostname= for insights config file --- library/insights_config.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/insights_config.py b/library/insights_config.py index ef7ff7b..f8373ab 100644 --- a/library/insights_config.py +++ b/library/insights_config.py @@ -47,6 +47,16 @@ - This set an optional proxy for the insights client to connect through if the client is behind a firewall or requires a proxy. Default is unspecified (none). required: false + obfuscate: + description: + - Obfuscate IP addresses. + Default is unspecified (none). + required: false + obfuscate_hostname: + description: + - Obfuscate hostname. Requires obfuscate=True. + Default is unspecified (none). + required: false ''' EXAMPLES = ''' @@ -57,6 +67,8 @@ auto_config: False or "{{ auto_config }}" authmethod: BASIC or "{{ authmethod }}" proxy: "{{ insights_proxy }}" + obfuscate: "{{ insights_obfuscate }}" + obfuscate_hostname: "{{ insights_obfuscate_hostname }}" become: true - name: Configure the insights client to register with RHSM and no display name From 5032ba7f702dbae24ad9dff1115ea5230718b51c Mon Sep 17 00:00:00 2001 From: reflop <30730390+reflop@users.noreply.github.com> Date: Thu, 23 Jul 2020 18:38:28 +0200 Subject: [PATCH 4/4] Add var for obfuscate= and obfuscate_hostname= for insights config file --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index f70f493..6466ae1 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,14 @@ See the section 'Example Playbook' for information on various ways to use these If the insights client is behind a proxy or firewall, a proxy can be specified. Default is unspecified. Ex: http://user:pass@192.168.100.50:8080 + +* insights_obfuscate: (optional) + + Obfuscate IP addresses. Can be set to "True" or "False". Default is unspecified. + +* insights_obfuscate_hostname: (optional) + + Obfuscate hostname. Requires obfuscate=True. Can be set to "True" or "False". Default is unspecified. * ansible_python_interpreter: (see Requirements above to determine if this is needed)