Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding support for "obfuscate" and "obfuscate_hostname". #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]: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)

Expand Down
4 changes: 3 additions & 1 deletion action_plugins/insights_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
12 changes: 12 additions & 0 deletions library/insights_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '''
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down