splunk / ansible-role-for-splunk

Splunk@Splunk's Ansible role for installing Splunk, upgrading Splunk, and installing apps/addons on Splunk deployments (VM/bare metal)
Apache License 2.0
147 stars 103 forks source link

configure_idxc_sh and configure_idxc_member are hard coded for master_uri #198

Open BSonPosh opened 1 year ago

BSonPosh commented 1 year ago

This causes deprecated errors.

- name: Configure search head to join indexer cluster
  command: "{{ splunk_home }}/bin/splunk edit cluster-config -mode searchhead -master_uri {{ splunk_uri_cm }} -secret {{ splunk_idxc_key }} -auth {{ splunk_auth }}"
  become: true
  become_user: "{{ splunk_nix_user }}"
  register: idxc_sh_join_result
  changed_when: idxc_sh_join_result.rc == 0
  failed_when: idxc_sh_join_result.rc != 0
  notify: restart splunk
  no_log: true
  until: idxc_sh_join_result.rc == 0
  retries: 6
  delay: 5
arcsector commented 1 year ago

Can you open a PR following the logic in configure_idxc_manager.yml to contextually switch from the master_uri arg to the manager_uri var? Should look something like this:

- name: Run splunk version command to check currently installed version
  include_tasks: check_splunk_version.yml

# Splunk version < 8.1 supports mode=master
# https://docs.splunk.com/Documentation/Splunk/8.0.9/Indexer/Configuremasterwithserverconf
# Splunk version >= 8.1 supports mode=manager
# https://docs.splunk.com/Documentation/Splunk/latest/Indexer/Configuremanagerwithserverconf
- name: Setting clustering mode based on Splunk version number
  set_fact:
    mode_value: "{% if splunk_version_release | float < 8.1 %}master{% else %}manager{% endif %}"
BSonPosh commented 1 year ago

Sure... I am teaching class this week but I will make a point to create the PR next week