forked from splunk/splunk-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.yml
40 lines (36 loc) · 1.24 KB
/
site.yml
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
31
32
33
34
35
36
37
38
39
40
---
- name: Run default Splunk provisioning
hosts: localhost
gather_facts: true
vars:
splunk_search_head_captain: false
tasks:
- block:
- name: Determine captaincy
set_fact:
splunk_search_head_captain: true
when:
- ansible_hostname == lookup('env', 'SPLUNK_SEARCH_HEAD_CAPTAIN_URL') or splunk.role == "splunk_search_head_captain"
- name: Execute pre-setup playbooks
include_tasks: execute_adhoc_plays.yml
vars:
playbook: "{{ ansible_pre_tasks }}"
when:
- ansible_pre_tasks is defined
- ansible_pre_tasks is not none
- ansible_pre_tasks is match("^(http|https|file)://.*")
- name: Provision role
include_role:
name: "{{ splunk.role }}"
when:
- splunk.role is defined
- name: Execute post-setup playbooks
include_tasks: execute_adhoc_plays.yml
vars:
playbook: "{{ ansible_post_tasks }}"
when:
- ansible_post_tasks is defined
- ansible_post_tasks is not none
- ansible_post_tasks is match("^(http|https|file)://.*")
become: yes
become_user: "{{ splunk.user }}"