forked from splunk/docker-swarm-splunk-hf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinventory.yml
84 lines (73 loc) · 3.56 KB
/
inventory.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
all:
children:
# docker_nodes is the parent group for docker_build_hosts and docker_swarm_nodes
docker_nodes:
children:
# defines which host will perform the build
# only the first host in this group will ever be used
docker_build_hosts:
hosts:
# for these examples we'll build images on the same host ansible is running on
# but we give it a made up name, which doesn't matter as we override connection
docker-build:
ansible_host: localhost
ansible_connection: local
docker_swarm_nodes:
children:
# swarm managers are a subset of swarm nodes that are defined as managers of the node
# however it is valid, and potentially preferred, for all swarm nodes to be managers
docker_swarm_managers:
hosts:
# for these examples we'll deploy images on the same host ansible is running on
# but we give it a made up name, which doesn't matter as we override connection
docker-swarm01:
ansible_hostname: localhost
ansible_connection: local
# because we plan on deploying all of our images that we've built, docker_services is a group that contains
# docker_build_images
docker_services:
children:
docker_build_images:
# each image we want to build is defined as a host, and thus can make use of ansible's variable precedence
hosts:
# don't do much other than run splunk
hello_swarm_forwarder:
# every image definition must have a version
version: 1.0.0
# enable healthcheck for the _internal index
internal_healthcheck_forwarder:
# remember every image must have a version number
version: 1.0.0
# in splunk's metrics.log
# for the per_index_thruput group
healthcheck_metrics_group: per_index_thruput
# for the _internal series
healthcheck_metrics_series: _internal
# expect to see non-zero thruput no older than 60 seconds
healthcheck_allowed_age_seconds: 6
# enable healthcheck for the _internal and _audit indexes
internal_introspection_healthchecks_forwarder:
version: 1.0.0
metrics_healthchecks:
- group: per_index_thruput
series: _internal
# 6 seconds will show how this check is sometimes stale, then recovers
allowed_age_seconds: 6
- group: per_index_thruput
series: _introspection
# 60 seconds should always show this check as fresh
allowed_age_seconds: 60
# bind mount
volumes_mounted_forwarder:
version: 1.0.0
host_volumes:
# create a bind mount to see how the container can be made aware of specific host data
- mount_type: service_bind
source: /etc/hosts
target: "{{ splunk_home }}/host_etc_hosts"
# create a persistent volume for $SPLUNK_HOME/var
# note that if your swarm nodes don't have a common storage path, this likely needs to be NFS
# or it's only persistent per node, and not across all nodes
- mount_type: service_volume
name: volumes_mounted_forwarder_service_volume
path: "{{ splunk_home }}/var"