Skip to content

Commit

Permalink
Merge 'CSPL_2353' into github.com:splunk/splunk-ansible
Browse files Browse the repository at this point in the history
  • Loading branch information
akondur committed Apr 25, 2023
2 parents a03d09c + 64ba861 commit 2dd12c8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion roles/splunk_cluster_master/tasks/setup_multisite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

- name: Convert Extrenal Cluster Master Name into Internal URI
set_fact:
multisite_master_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"
multisite_manager_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"

- name: Set the multisite master
command: "{{ splunk.exec }} edit cluster-config -mode master -multisite true -available_sites {{ splunk.all_sites }} -site {{ splunk.site }} -site_replication_factor origin:{{ splunk.multisite_replication_factor_origin }},total:{{ splunk.multisite_replication_factor_total }} -site_search_factor origin:{{ splunk.multisite_search_factor_origin }},total:{{ splunk.multisite_search_factor_total }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/splunk_common/tasks/add_splunk_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
- licenses and licenses | length > 0
- "not ('license_master_url' in splunk and splunk.license_master_url) or splunk.role == 'splunk_license_master'"

- name: Set as license slave
include_tasks: set_as_license_slave.yml
- name: Set as license peer
include_tasks: set_as_license_peer.yml
when:
- "'license_master_url' in splunk and splunk.license_master_url"
- splunk.role != "splunk_license_master"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
command: "{{ splunk.exec }} edit licenser-localslave -manager_uri {{ splunk.license_master_url }} -auth '{{ splunk.admin_user }}:{{ splunk.password }}'"
become: yes
become_user: "{{ splunk.user }}"
register: linux_set_lic_slave
until: linux_set_lic_slave.rc == 0
changed_when: linux_set_lic_slave.rc == 0 and "licenser-localslave object has been edited" in linux_set_lic_slave.stdout
failed_when: linux_set_lic_slave.rc !=0 and "does not support being a remote master" in linux_set_lic_slave.stderr
register: linux_set_lic_peer
until: linux_set_lic_peer.rc == 0
changed_when: linux_set_lic_peer.rc == 0 and "licenser-localpeer object has been edited" in linux_set_lic_peer.stdout
failed_when: linux_set_lic_peer.rc !=0 and "does not support being a remote master" in linux_set_lic_peer.stderr
retries: "{{ retry_num }}"
delay: "{{ retry_delay }}"
notify:
Expand Down
4 changes: 2 additions & 2 deletions roles/splunk_indexer/tasks/setup_multisite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

- name: Convert Extrenal Cluster Master Name into Internal URI
set_fact:
multisite_master_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"
multisite_manager_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"

- name: Setup Peers with Associated Site
command: "{{ splunk.exec }} edit cluster-config -mode slave -site {{ splunk.site }} -master_uri {{ multisite_master_uri }} -replication_port {{ splunk.idxc.replication_port }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
command: "{{ splunk.exec }} edit cluster-config -mode peer -site {{ splunk.site }} -manager_uri {{ multisite_manager_uri }} -replication_port {{ splunk.idxc.replication_port }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
become: yes
become_user: "{{ splunk.user }}"
register: task_result
Expand Down
6 changes: 3 additions & 3 deletions roles/splunk_monitor/tasks/setup_multisite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

- name: Convert Extrenal Cluster Master Name into Internal URI
set_fact:
multisite_master_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"
multisite_manager_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"

- name: Setup SH - Multisite
command: "{{ splunk.exec }} edit cluster-config -mode searchhead -master_uri {{ multisite_master_uri }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
command: "{{ splunk.exec }} edit cluster-config -mode searchhead -manager_uri {{ multisite_manager_uri }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
become: yes
become_user: "{{ splunk.user }}"
register: set_new_master
Expand All @@ -28,7 +28,7 @@
- include_tasks: ../../../roles/splunk_common/tasks/wait_for_splunk_process.yml

- name: Setup SH with Associated Site
command: "{{ splunk.exec }} edit cluster-master -old_master_uri {{ multisite_master_uri }} -site {{ splunk.site }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }} -multisite True"
command: "{{ splunk.exec }} edit cluster-master -old_manager_uri {{ multisite_manager_uri }} -site {{ splunk.site }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }} -multisite True"
become: yes
become_user: "{{ splunk.user }}"
register: set_associated_site
Expand Down
6 changes: 3 additions & 3 deletions roles/splunk_search_head/tasks/setup_multisite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

- name: Convert Extrenal Cluster Master Name into Internal URI
set_fact:
multisite_master_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"
multisite_manager_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"

- name: Setup SHC - Multisite
command: "{{ splunk.exec }} edit cluster-config -mode searchhead -master_uri {{ multisite_master_uri }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
command: "{{ splunk.exec }} edit cluster-config -mode searchhead -manager_uri {{ multisite_manager_uri }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
become: yes
become_user: "{{ splunk.user }}"
register: set_new_master
Expand All @@ -28,7 +28,7 @@
- include_tasks: ../../../roles/splunk_common/tasks/wait_for_splunk_process.yml

- name: Setup SHC with Associated Site
command: "{{ splunk.exec }} edit cluster-master -old_master_uri {{ multisite_master_uri }} -site {{ splunk.site }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }} -multisite True"
command: "{{ splunk.exec }} edit cluster-master -old_manager_uri {{ multisite_manager_uri }} -site {{ splunk.site }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }} -multisite True"
become: yes
become_user: "{{ splunk.user }}"
register: set_associated_site
Expand Down
6 changes: 3 additions & 3 deletions roles/splunk_search_head_captain/tasks/setup_multisite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

- name: Convert External Cluster Master Name into Internal URI
set_fact:
multisite_master_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"
multisite_manager_uri: "{{ cert_prefix }}://{{ splunk.multisite_master }}:{{ splunk.svc_port }}"

- name: Setup SHC - Captain
command: "{{ splunk.exec }} edit cluster-config -mode searchhead -master_uri {{ multisite_master_uri }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
command: "{{ splunk.exec }} edit cluster-config -mode searchhead -manager_uri {{ multisite_manager_uri }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }}"
become: yes
become_user: "{{ splunk.user }}"
register: set_new_master
Expand All @@ -28,7 +28,7 @@
- include_tasks: ../../../roles/splunk_common/tasks/wait_for_splunk_process.yml

- name: Setup SHC with Associated Site - Captain
command: "{{ splunk.exec }} edit cluster-master -old_master_uri {{ multisite_master_uri }} -site {{ splunk.site }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }} -multisite True"
command: "{{ splunk.exec }} edit cluster-master -old_manager_uri {{ multisite_manager_uri }} -site {{ splunk.site }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -secret {{ splunk.idxc.pass4SymmKey }} -multisite True"
become: yes
become_user: "{{ splunk.user }}"
register: set_associated_site
Expand Down

0 comments on commit 2dd12c8

Please sign in to comment.