From 4b48c74b1e5781e05f99ffab253d3eac57a6c054 Mon Sep 17 00:00:00 2001 From: Bruno Pelaia Date: Wed, 27 Dec 2023 22:29:32 +0100 Subject: [PATCH] pull request #210 --- roles/splunk/defaults/main.yml | 3 +++ roles/splunk/tasks/configure_dmc.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/splunk/defaults/main.yml b/roles/splunk/defaults/main.yml index 5bca9ecc..1aafc5ca 100644 --- a/roles/splunk/defaults/main.yml +++ b/roles/splunk/defaults/main.yml @@ -52,6 +52,9 @@ git_version: master # Configure default version to clone, overridable inside the app_relative_path: # set a sub-path you want to sync within a repo. If the repo contains multiple apps in the root directory, just set this to a trailing slash. splunk_app_deploy_path: undefined # Path under $SPLUNK_HOME/ to deploy apps to - Note that this may be set in group_vars, host_vars, playbook vars, or inside the git_apps dictionary within host_vars splunk_auditd_configure: false # Whether or not to install auditd filtering rules for splunk launched executables +# DMC Vars +splunk_dmc_not_indexer_host_expression: 'all:!indexers' +splunk_dmc_not_indexers_list: "{{ query('inventory_hostnames', splunk_dmc_not_indexer_host_expression) }}" # List of all inventory items that are not the indexers. If your configuration uses a nonstandard name for hostnames you can replace this with a different list. # IDXC Vars splunk_idxc_key: mypass4symmkey splunk_idxc_rf: 2 diff --git a/roles/splunk/tasks/configure_dmc.yml b/roles/splunk/tasks/configure_dmc.yml index 546f3aee..0a81775d 100644 --- a/roles/splunk/tasks/configure_dmc.yml +++ b/roles/splunk/tasks/configure_dmc.yml @@ -9,7 +9,7 @@ - name: Configure systems as search peers to be monitored except indexers ansible.builtin.shell: | {{ splunk_home }}/bin/splunk add search-server https://{{ item }}:{{ splunkd_port }} -auth "{{ splunk_auth }}" -remoteUsername "{{ splunk_admin_username }}" -remotePassword "{{ splunk_admin_password }}" - loop: "{{ query('inventory_hostnames', 'all:!indexer') }}" + loop: "{{ splunk_dmc_not_indexers_list }}" become: true become_user: "{{ splunk_nix_user }}" no_log: true