Skip to content
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

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

Open
igsher opened this issue Apr 27, 2024 · 0 comments

Comments

@igsher
Copy link

igsher commented Apr 27, 2024

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant