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

draft: add hide_password to default vals; allow ansible inventory to read hi… #772

Merged
Merged
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
1 change: 0 additions & 1 deletion inventory/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def getDefaultVars():
if os.environ.get("SPLUNK_HOME_OWNERSHIP_ENFORCEMENT", "").lower() == "false":
defaultVars["splunk_home_ownership_enforcement"] = False
# Determine password visibility
defaultVars["hide_password"] = False
if os.environ.get("HIDE_PASSWORD", "").lower() == "true":
defaultVars["hide_password"] = True
# Determine SHC preferred captaincy
Expand Down
1 change: 1 addition & 0 deletions inventory/splunk_defaults_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ansible_post_tasks:
ansible_environment: {}
retry_delay: 6
retry_num: 60
hide_password: false
wait_for_splunk_retry_num: 60
shc_sync_retry_num: 60

Expand Down
1 change: 1 addition & 0 deletions inventory/splunk_defaults_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ansible_post_tasks:
ansible_environment: {}
retry_delay: 10
retry_num: 60
hide_password: false
wait_for_splunk_retry_num: 150
shc_sync_retry_num: 300

Expand Down
1 change: 1 addition & 0 deletions inventory/splunkforwarder_defaults_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ansible_post_tasks:
ansible_environment: {}
retry_delay: 6
retry_num: 60
hide_password: false
wait_for_splunk_retry_num: 60
shc_sync_retry_num: 60

Expand Down
1 change: 1 addition & 0 deletions inventory/splunkforwarder_defaults_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ansible_post_tasks:
ansible_environment: {}
retry_delay: 10
retry_num: 60
hide_password: false
wait_for_splunk_retry_num: 150
shc_sync_retry_num: 300

Expand Down
2 changes: 2 additions & 0 deletions roles/splunk_common/tasks/apply_licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
vars:
licenses: "{{ license }}"
when: '"*" in license'
no_log: "{{ hide_password }}"

- include_tasks: licenses/add_license.yml
vars:
lic: "{{ license }}"
when:
- license | lower != "free"
- '"*" not in license'
no_log: "{{ hide_password }}"
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
path: /home/splunk/.bash_profile
line: "JAVA_HOME=/home/splunk/java-se-9-ri/jdk-9/"
create: yes
no_log: "{{ hide_password }}"

- name: Write path into .bash_profile
lineinfile:
path: /home/splunk/.bash_profile
line: "PATH=$PATH:$JAVA_HOME/bin"
create: yes
no_log: "{{ hide_password }}"
1 change: 1 addition & 0 deletions roles/splunk_common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
conf_stanzas: "{{ item.value.content | default({}) }}"
with_items: "{% if splunk.conf is mapping %}{{ splunk.conf | dict2items }}{% else %}{{ splunk.conf }}{% endif %}"
when: "'conf' in splunk and splunk.conf"
no_log: "{{ hide_password }}"

# Generate outputs.conf before splunk starts to prevent data being indexed locally
- include_tasks: enable_forwarding.yml
Expand Down
1 change: 1 addition & 0 deletions roles/splunk_common/tasks/set_as_license_slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
scheme: "{{ splunk.license_master_url | urlsplit('scheme') }}"
splunk_instance_address: "{{ splunk.license_master_url | urlsplit('hostname') }}"
port: "{{ splunk.license_master_url | urlsplit('port') }}"
no_log: "{{ hide_password }}"

- name: Set node as license slave
command: "{{ splunk.exec }} edit licenser-localslave -master_uri {{ splunk.license_master_url }} -auth '{{ splunk.admin_user }}:{{ splunk.password }}'"
Expand Down
1 change: 1 addition & 0 deletions roles/splunk_common/tasks/set_config_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
with_dict: "{{ conf_stanzas }}"
loop_control:
loop_var: stanza
no_log: "{{ hide_password }}"