You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains Splunk's official Ansible role for performing Splunk administration of remote hosts over SSH. This role can manage Splunk Enterprise and Universal Forwarders that are on Linux-based platforms (CentOS/Redhat/Ubuntu), as well as deploy configurations from Git repositories. Example playbooks and inventory files are also provided to help new Ansible users make the most out of this project.
6
+
This repository contains Splunk's official Ansible role for performing Splunk administration of remote hosts over SSH. This role can manage Splunk Enterprise and Universal Forwarders that are on Linux-based platforms (CentOS/Redhat/Ubuntu/Amazon Linux/OpenSUSE), as well as deploy configurations from Git repositories. Example playbooks and inventory files are also provided to help new Ansible users make the most out of this project.
7
7
8
8
ansible-role-for-splunk is used by the Splunk@Splunk team to manage Splunk's corporate deployment of Splunk.
9
9
@@ -125,7 +125,7 @@ This section contains additional reference documentation.
125
125
126
126
Note: Any task with an **adhoc** prefix means that it can be used independently as a `deployment_task` in a playbook. You can use the tasks to resolve various Splunk problems or perform one-time activities, such as decommissioning an indexer from an indexer cluster.
127
127
128
-
-**adhoc_clean_dispatch.yml** - This task is intended to be used for restoring service to search heads should the dispatch directory become full. You should need to use this task in a healthy environment, but it is at your disposal should the need arise. The task will stop splunk, remove all files in the dispatch directory, and then start splunk.
128
+
-**adhoc_clean_dispatch.yml** - This task is intended to be used for restoring service to search heads should the dispatch directory become full. You should not need to use this task in a healthy environment, but it is at your disposal should the need arise. The task will stop splunk, remove all files in the dispatch directory, and then start splunk.
129
129
-**adhoc_configure_hostname** - Configure a Splunk server's hostname using the value from inventory_hostname. It configures the system hostname, serverName in server.conf and host in inputs.conf. All Splunk configuration changes are made using the ini_file module, which will preserve any other existing configurations that may exist in server.conf and/or inputs.conf.
130
130
-**adhoc_decom_indexer.yml** - Executes a splunk offline --enforce-counts command. This is useful when decommissioning one or more indexers from an indexer cluster.
131
131
-**adhoc_fix_mongo.yml** - Use when Splunk is in a stopped state to fix mongodb/kvstore issues. This task ensures that permissions are set correctly on mongo's splunk.key file and deletes mongod.lock if it exists.
@@ -152,7 +152,10 @@ Note: Any task with an **adhoc** prefix means that it can be used independently
152
152
-**configure_splunk_secret.yml** - Configures a common splunk.secret file from the files/authentication/splunk.secret so that pre-hashed passwords can be securely deployed. Note that changing splunk.secret will require re-encryption of any passwords that were encrypted using the previous splunk.secret since Splunk will no longer be able to decrypt them successfully.
153
153
-**configure_systemd.yml** - Updates Splunk's systemd file using best practices and tips from the community. Also allows Splunk to start successfully using systemd after an upgrade without the need to run `splunk ftr --accept-license`.
154
154
-**configure_thp.yml** - Installs a new systemd service (disable-thp) that disables THP for RedHat|CentOS systems 6.0+. This task is automatically called by the configure_os.yml task. Optionally, you can set `use_tuned_thp` to configure THP via `tuned` instead of a service. Default is `false`. Mote: Make sure your host does not require a specific `tuned` profile before applying this one.
155
-
-**download_and_unarchive.yml** - Downloads the appropriate Splunk package to the Ansible host using `splunk_package_url` (derived automatically from the values of `splunk_package_url_full` or `splunk_package_url_uf` variables). The package is then installed to `splunk_install_path` (derived automatically in main.yml using the `splunk_install_path` and the host's membership of either a `uf` or `full` group in the inventory).
155
+
-**download_and_unarchive.yml** - Downloads the appropriate Splunk package using `splunk_package_url` (derived automatically from the values of `splunk_package_url_full` or `splunk_package_url_uf` variables). The package is then installed to `splunk_install_path` (derived automatically in main.yml using the `splunk_install_path` and the host's membership of either a `uf` or `full` group in the inventory).
156
+
You can set if the download/unarchive process uses the Ansible host or if each host downloads and unarchives the package individually by setting `splunk_download_local`.
157
+
Default is `true` which will download the package to the Ansible host once and unarchive to each host from there.
158
+
If set to `false` the package will be downloaded and unarchived to each host individually. Immediately after unarchive the package will be removed from the host.
156
159
-**install_apps.yml** - *Do not call install_apps.yml directly! Use configure_apps.yml* - Called by configure_apps.yml to perform app installation on the Splunk host.
157
160
- **install_splunk.yml** - *Do not call install_splunk.yml directly! Use check_splunk.yml* - Called by check_splunk.yml to install/upgrade Splunk and Splunk Universal Forwarders, as well as perform any initial configurations. This task is called by check_splunk.yml when the check determines that Splunk is not currently installed. This task will create the splunk user and splunk group, configure the bash profile for the splunk user (by calling configure_bash.yml), configure THP and ulimits (by calling configure_os.ym), download and install the appropriate Splunk package (by calling download_and_unarchive.yml), configure a common splunk.secret (by calling configure_splunk_secret.yml, if configure_secret is defined), create a deploymentclient.conf file with the splunk_ds_uri and clientName (by calling configure_deploymentclient.yml, if clientName is defined), install a user-seed.conf with a prehashed admin password (if used_seed is defined), and will then call the post_install.yml task. See post_install.yml entry for details on post-installation tasks.
158
161
-**install_utilities.yml** - Installs Linux packages that are useful for troubleshooting Splunk-related issues when `install_utilities: true` and `linux_packages` is defined with a list of packages to install.
@@ -165,7 +168,7 @@ Note: Any task with an **adhoc** prefix means that it can be used independently
165
168
-**splunk_restart.yml** - Restarts splunk via the service module. Used when waiting for a handler to run at the end of the play would be inappropriate.
166
169
-**splunk_start.yml** - Starts splunk via the service module. Used when waiting for a handler to run at the end of the play would be inappropriate.
167
170
-**splunk_stop.yml** - Stops splunk via the service module. Used when waiting for a handler to run at the end of the play would be inappropriate.
168
-
-**upgrade_splunk.yml** - *Do not call upgrade_splunk.yml directly! Use check_splunk.yml* - Called by check_splunk.yml. Performs an upgrade of an existing splunk installation. Configures .bash_profile and .bashrc for splunk user (by calling configure_bash.yml), disables THP and increases ulimits (by calling configure_os.yml), kills any stale splunkd processes present (by calling adhoc_kill_splunkd.yml). Note: You should NOT run the upgrade_splunk.yml task directly from a playbook. check_splunk.yml will call upgrade_splunk.yml if it determines that an upgrade is needed; It will then download and unarchive the new version of Splunk (by calling download_and_unarchive.yml), ensure that mongod is in a good stopped state (by calling adhoc_fix_mongo.yml), and will then perform post-installation tasks using the post_install.yml task.
171
+
-**upgrade_splunk.yml** - *Do not call upgrade_splunk.yml directly! Use check_splunk.yml* - Called by check_splunk.yml. Performs an upgrade of an existing splunk installation. Configures .bash_profile and .bashrc for splunk user (by calling configure_bash.yml), disables THP and increases ulimits (by calling configure_os.yml), kills any stale splunkd processes present when `splunk_force_kill` is set to `True`(by calling adhoc_kill_splunkd.yml). Note: You should NOT run the upgrade_splunk.yml task directly from a playbook. check_splunk.yml will call upgrade_splunk.yml if it determines that an upgrade is needed; It will then download and unarchive the new version of Splunk (by calling download_and_unarchive.yml), ensure that mongod is in a good stopped state (by calling adhoc_fix_mongo.yml), and will then perform post-installation tasks using the post_install.yml task.
169
172
170
173
## Frequently Asked Questions
171
174
**Q:** What is the difference between this and splunk-ansible?
splunk_download_local: true # This defines how the download process works. If `true` it will download to localhost and copy around to hosts from there. If `false` each host will download the package individually.
13
14
splunk_install_type: undefined # There are two ways to configure this. The easiest way is to nest hosts under either a "full" group or a "uf" group in your inventory and main.yml will handle it for you. Or, you can also set the value via a group_vars or host_vars file.
14
15
splunk_install_path: /opt # Base directory on the operating system to which splunk should be installed
15
16
least_privileged: false # Do not change. This get automatically set in `tasks/main.yml` based on the version and install type.
16
17
splunk_nix_user: splunk
17
18
splunk_nix_group: splunk
19
+
local_os_user: false # Whenther or not to force creation of a user using the `luseradd` or not.
20
+
local_os_group: false # Whether or not to force creation of a group using the `lgroupadd` or not.
18
21
splunk_uri_lm: undefined
19
22
splunk_license_file: [] # This can be a list of license files to copy to the host.
20
23
splunk_license_group: Trial # The default matches with the group splunk ships with. You can also set the value via a group_vars or host_vars file.
splunk_create_polkit: 0# If set to 1 `enable boot-start` will create a polkit rules file allowing the 'splunk_nix_user' to restart the splunk service without authentication.
36
39
splunk_use_initd: false # If set to true, the system will use init.d. Default false
37
40
splunk_use_systemd: true # DO NOT EDIT. To use init.d, set `splunk_use_initd` to true.
41
+
splunk_force_kill: False
38
42
systemd_unit_full: Splunkd # You can change this in `host_vars` or `group_vars` to customize the service name.
39
43
systemd_unit_uf: SplunkForwarder # You can change this in `host_vars` or `group_vars` to customize the service name.
40
44
splunk_disable_mgmt_port: false # If set to true, will disable splunkd management port during installation
@@ -72,19 +76,16 @@ add_pstack_script: false # Set to true to install a pstack generation script for
72
76
configure_dmesg: false
73
77
install_utilities: false # Set to true to install the list of packages defined in the linux_packages var after installing splunk
74
78
use_tuned_thp: false
75
-
linux_packages:
76
-
- nload
77
-
- iotop
78
-
- iftop
79
-
- sysstat
80
-
- telnet
81
-
- tcpdump
82
-
- htop
83
-
- atop
84
-
- lsof
85
-
- policycoreutils-python
86
-
- policycoreutils
87
-
- setroubleshoot
88
-
- nethogs
89
-
- gdb
90
-
- bind-utils
79
+
# Firewall configs
80
+
configure_firewall: false # Whether or not to configure the firewall service on your machine, if set to true, opens firewall ports using UFW (default) or Firewalld depending on OS
81
+
splunk_firewall_service: splunk # The name of the Splunk firewall service to install for firewalld
82
+
# Firewall port presets - reference these in group_vars to assign them to splunk
0 commit comments