Issues with "Configure systems as search peers to be monitored except indexers" in configure_dmc.yml:
The task fails if 'splunk add search-server' command fails with error "A peer with uri of https://<>:8089 already exists.", instead of ignoring the error.
The task attempts to add the node it's running on as it's own search peer and fails. (duplicate of issue #214)
Proposed fix:
- 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')|difference([inventory_hostname]) }}"
become: true
become_user: "{{ splunk_nix_user }}"
register: dmc_add_search_peer_result
no_log: true
failed_when:
- "dmc_add_search_peer_result.rc != 0"
- "'already exists' not in dmc_add_search_peer_result.stderr"
changed_when:
- "'Peer added' in dmc_add_search_peer_result.stdout"
Issues with "Configure systems as search peers to be monitored except indexers" in configure_dmc.yml:
Proposed fix: