Skip to content

Change configure_dmc to use a var #210

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions roles/splunk/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ git_project: undefined
git_version: master # Configure default version to clone, overridable inside the git_apps dictionary within host_vars
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
# 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
Expand Down
4 changes: 2 additions & 2 deletions roles/splunk/tasks/configure_dmc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Check splunk
include_task: check_splunk.yml
include_tasks: check_splunk.yml

- name: Configure DMC as a IDXC member
include_tasks: configure_idxc_sh.yml
Expand All @@ -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
Expand Down