-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearchHead.yml
More file actions
30 lines (21 loc) · 1.05 KB
/
searchHead.yml
File metadata and controls
30 lines (21 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- name: Search Head
connection: ssh
hosts: search
vars_prompt:
- name: artifact_RF
prompt: Declare search artifact replication factor
private: no
tasks:
- set_fact:
manager_IP: "{{ groups['manager'][0] }}"
secret: "{{lookup('file', './droppings/shcluster.conf') | regex_findall('(?<=pass4SymmKey = )(.*)') }}"
shcluster_label: "{{lookup('file', './droppings/shcluster.conf') | regex_findall('(?<=shcluster_label = )(.*)') }}"
- include_tasks: install.yml
- include_tasks: licenseSlave.yml
- name: Configure as search head
shell: /opt/splunk/bin/splunk edit cluster-config -mode searchhead -master_uri "https://{{ manager_IP }}:8089"
become: yes
- name: Initialize as cluster member
shell: /opt/splunk/bin/splunk init shcluster-config -mgmt_uri "https://{{ ansible_ssh_host }}:8089" -secret {{ secret }} -replication_port 34587 -replication_factor {{ artifact_RF }} -conf_deploy_fetch_url "https://{{ manager_IP }}:8089" -shcluster_label {{ shcluster_label }}
become: yes
- include_tasks: restart.yml