-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62da01e
commit c2bd88b
Showing
14 changed files
with
158 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,73 @@ | ||
all: | ||
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 | ||
localhost: | ||
connection: local | ||
|
||
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 | ||
|
||
# perform the check every 30 seconds | ||
healthcheck_interval_seconds: 30 | ||
|
||
# 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 | ||
# 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 | ||
|
||
# perform the check every 30 seconds | ||
healthcheck_interval_seconds: 30 | ||
|
||
# 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 | ||
|
||
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
# the volume_ variables are templated in this role's vars/main.yml | ||
|
||
- name: create volume's persistent storage path | ||
- name: create nfs volume's persistent storage path | ||
file: | ||
path: "{{ volume_create_path }}" | ||
state: directory | ||
owner: "{{ volume_owner }}" | ||
group: "{{ volume_group }}" | ||
when: volume_create_path != '' | ||
become: true | ||
when: volume_type == 'nfs' and volume_create_path != '' | ||
|
||
# each node needs to be individually configured for the volume | ||
- name: create volume | ||
docker_volume: | ||
name: "{{ volume_name }}" | ||
driver: "{{ volume_driver }}" | ||
driver: "{{ volume_driver | default(omit) }}" | ||
driver_options: | ||
type: "{{ volume_driver_option_type }}" | ||
o: "{{ volume_driver_option_o }}" | ||
device: "{{ volume_driver_option_device }}" | ||
type: "{{ volume_driver_option_type | default(omit) }}" | ||
o: "{{ volume_driver_option_o | default(omit) }}" | ||
device: "{{ volume_driver_option_device | default(omit) }}" | ||
state: present | ||
become: true | ||
become: "{{ docker_become_user is defined }}" | ||
become_user: "{{ docker_become_user|default(omit) }}" | ||
loop: "{{ groups['docker_swarm_nodes'] }}" | ||
delegate_to: "{{ item }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters