Skip to content

Commit 02e702a

Browse files
author
Mason Morales
authored
Merge pull request #100 from splunk/updates09142021
Multiple updates
2 parents d8a2951 + 7cdb092 commit 02e702a

File tree

8 files changed

+40
-8
lines changed

8 files changed

+40
-8
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ Note: Any task with an **adhoc** prefix means that it can be used independently
136136
- **configure_bash.yml** - Configures bashrc and bash_profile files for the splunk user. Please note that the templates included with this role will overwrite any existing files for the splunk user (if they exist). The templates will define a custom PS1 at the bash prompt, configure the $SPLUNK_HOME environment variable so that you can issue "splunk <command>" without specifying the full path to the Splunk binary, and will enable auto-completion of Splunk CLI commands in bash.
137137
- **configure_deploymentclient.yml** - Generates a new deploymentclient.conf file from the deploymentclient.conf.j2 template and installs it to $SPLUNK_HOME/etc/system/local/deploymentclient.conf. This task is included automatically during new installations when values have been configured for the `clientName` and `splunk_uri_ds` variables.
138138
- **configure_facl.yml** - Configure file system access control lists (FACLs) to allow the splunk user to read /var/log files and add the splunk user's group to /etc/audit/auditd.conf to read /var/log/audit/ directory. This allows the splunk user to read privileged files from a non-privileged system account. Note: This task is performed automatically during new installations when splunk is installed as a non-root user.
139+
- **configure_idxc_manager.yml** - Configures a Splunk host to act as a manager node using `splunk_idxc_rf`, `splunk_idxc_sf`, `splunk_idxc_key`, and `splunk_idxc_label`.
140+
- **configure_idxc_member.yml** - Configures a Splunk host as an indexer cluster member using `splunk_uri_cm`, `splunk_idxc_rep_port`, and `splunk_idxc_key`.
141+
- **configure_idxc_sh.yml** - Configures a search head to join an existing indexer cluster using `splunk_uri_cm` and `splunk_idxc_key`.
139142
- **configure_license.yml** - Configure the license master URI in server.conf for full Splunk installations when `splunk_uri_lm` has been defined. Note: This could also be accomplished using configure_apps.yml with a git repository.
140143
- **configure_os.yml** - Increases ulimits for the splunk user and disables Transparent Huge Pages (THP) per Splunk implementation best practices.
141144
- **configure_serverclass.yml** - Generates a new serverclass.conf file from the serverclass.conf.j2 template and installs it to $SPLUNK_HOME/etc/system/local/serverclass.conf.

configure_idxc_sh.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
- name: Configure search head to join indexer cluster
3+
command: "{{ splunk_home }}/bin/splunk edit cluster-config -mode searchhead -master_uri {{ splunk_uri_cm }} -secret {{ splunk_idxc_key }} -auth {{ splunk_auth }}"
4+
become: true
5+
become_user: "{{ splunk_nix_user }}"
6+
register: idxc_sh_join_result
7+
changed_when: idxc_sh_join_result == 0
8+
failed_when: idxc_sh_join_result != 0
9+
notify: restart splunk
10+
no_log: true
11+
until: idxc_sh_join_result == 0
12+
retries: 6
13+
delay: 5

roles/splunk/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ splunk_uri_cm: undefined
1818
splunk_uri_ds: undefined # e.g. mydeploymentserver.mydomain.com:8089 ; Note that you must also configure the clientName var under either group_vars or host_vars for deploymentclient.conf to be configured
1919
clientName: undefined
2020
phoneHomeIntervalInSecs: undefined
21+
splunk_general_key: undefined # Configures a pass4SymmKey in server.conf under the general stanza
2122
splunk_ds_key: undefined # Configures a pass4SymmKey in server.conf for authenticating against a deployment server
2223
splunk_admin_username: admin
2324
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'

roles/splunk/files/splunk_ulimits.conf

Lines changed: 0 additions & 4 deletions
This file was deleted.

roles/splunk/tasks/adhoc_fix_server_certificate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
become_user: "{{ splunk_nix_user }}"
88
loop:
99
- "rm {{ splunk_home }}/etc/auth/server.pem"
10-
- "{{ splunk_home }}/bin/splunk createssl server-cert -d /opt/splunk/etc/auth -n server.pem"
10+
- "{{ splunk_home }}/bin/splunk createssl server-cert -d {{ splunk_home }}/etc/auth -n server.pem"
1111
notify:
1212
- restart splunk

roles/splunk/tasks/configure_license.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Set license master_uri
2+
- name: Set license master_uri in server.conf
33
ini_file:
44
path: "{{ splunk_home }}/etc/system/local/server.conf"
55
section: license
@@ -13,3 +13,18 @@
1313
when:
1414
- "'full' in group_names"
1515
- splunk_uri_lm != 'undefined'
16+
17+
- name: Set pass4SymmKey in the general stanza of server.conf
18+
ini_file:
19+
path: "{{ splunk_home }}/etc/system/local/server.conf"
20+
section: general
21+
option: pass4SymmKey
22+
value: "{{ splunk_general_key }}"
23+
owner: "{{ splunk_nix_user }}"
24+
group: "{{ splunk_nix_group }}"
25+
mode: 0644
26+
become: true
27+
notify: restart splunk
28+
when:
29+
- "'full' in group_names"
30+
- splunk_general_key != 'undefined'

roles/splunk/tasks/configure_os.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
include_vars: "{{ ansible_os_family }}.yml"
55

66
- name: Set ulimits for splunk
7-
copy:
8-
src: splunk_ulimits.conf
7+
template:
8+
src: splunk_ulimits.conf.j2
99
dest: /etc/security/limits.d/splunk_ulimits.conf
1010
owner: root
1111
group: root
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{ splunk_nix_user }} soft nofile 655350
2+
{{ splunk_nix_user }} hard nofile 819200
3+
{{ splunk_nix_user }} soft nproc 32768
4+
{{ splunk_nix_user }} hard nproc 51200

0 commit comments

Comments
 (0)