Skip to content

configure_dmc.yml - multiple issues in "Configure systems as search peers to be monitored except indexers" task #225

@igsher

Description

@igsher

Issues with "Configure systems as search peers to be monitored except indexers" in configure_dmc.yml:

  1. 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.
  2. The task attempts to add the node it's running on as it's own search peer and fails. (duplicate of issue Cluster deployment fails in configure_dmc.yml #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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions