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) 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(): 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 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