Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion roles/splunk/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ clientName: undefined
splunk_admin_username: admin
splunk_admin_password: undefined # Use ansible-vault encrypt_string, e.g. ansible-vault encrypt_string --ask-vault-pass 'var_value_to_encrypt' --name 'var_name'
splunk_configure_secret: false # If set to true, you need to update files/splunk.secret
splunk_secret_file: splunk.secret # Used to specify your splunk.secret filename(s), files should be placed in the "files" folder of the role
splunk_secret_file: undefined # Used to specify your splunk.secret filename(s), files should be placed in the "files" folder of the role
splunk_secret_text: undefined # Used to specify your splunk.secret via a text value
# Although there are tasks for the following Splunk configurations in this role, they are not included in any tasks by default. You can add them to your install_splunk.yml if you would like to have Ansible manage any of these files
splunk_configure_authentication: false
ad_bind_password: undefined # Use ansible-vault encrypt_string, e.g. ansible-vault encrypt_string --ask-vault-pass 'var_value_to_encrypt' --name 'var_name'
Expand Down
16 changes: 14 additions & 2 deletions roles/splunk/tasks/configure_splunk_secret.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Install splunk.secret
- name: Install splunk.secret from file
copy:
src: "{{ splunk_secret_file }}"
dest: "{{ splunk_home }}/etc/auth/splunk.secret"
Expand All @@ -7,4 +7,16 @@
mode: 0644
become: true
notify: restart splunk
when: splunk_configure_secret
when: splunk_configure_secret and splunk_secret_file is defined

- name: Install splunk.secret from text
template:
src: splunk.secret.j2
dest: "{{ splunk_home }}/etc/auth/splunk.secret"
owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
mode: 0644
become: true
notify: restart splunk
when: splunk_configure_secret and splunk_secret_text is defined

1 change: 1 addition & 0 deletions roles/splunk/templates/splunk.secret.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ splunk_secret_text }}