2015-01-24 02:09:03 +01:00
|
|
|
# Ansible Consul external inventory script settings.
|
|
|
|
|
|
|
|
[consul]
|
|
|
|
|
2017-12-13 14:33:28 +01:00
|
|
|
#
|
|
|
|
# Bulk load. Load all possible data before building inventory JSON
|
|
|
|
# If true, script processes in-memory data. JSON generation reduces drastically
|
|
|
|
#
|
|
|
|
bulk_load = false
|
|
|
|
|
2015-01-24 02:09:03 +01:00
|
|
|
# restrict included nodes to those from this datacenter
|
|
|
|
#datacenter = nyc1
|
|
|
|
|
2017-08-19 23:00:51 +02:00
|
|
|
# url of the consul cluster to query
|
2015-01-24 02:09:03 +01:00
|
|
|
#url = http://demo.consul.io
|
|
|
|
url = http://localhost:8500
|
|
|
|
|
|
|
|
# suffix added to each service to create a group name e.g Service of 'redis' and
|
|
|
|
# a suffix of '_servers' will add each address to the group name 'redis_servers'
|
|
|
|
servers_suffix = _servers
|
|
|
|
|
2017-12-13 14:33:28 +01:00
|
|
|
#
|
|
|
|
# By default, final JSON is built based on all available info in consul.
|
2018-09-21 20:56:35 +02:00
|
|
|
# Suffixes means that services groups will be added in addition to basic information. See servers_suffix for additional info
|
2017-12-13 14:33:28 +01:00
|
|
|
# There are cases when speed is preferable than having services groups
|
2018-09-21 20:56:35 +02:00
|
|
|
# False value will reduce script execution time drastically.
|
2017-12-13 14:33:28 +01:00
|
|
|
#
|
|
|
|
suffixes = true
|
|
|
|
|
2015-01-24 02:09:03 +01:00
|
|
|
# if specified then the inventory will generate domain names that will resolve
|
|
|
|
# via Consul's inbuilt DNS.
|
|
|
|
#domain=consul
|
|
|
|
|
|
|
|
# make groups from service tags. the name of the group is derived from the
|
|
|
|
# service name and the tag name e.g. a service named nginx with tags ['master', 'v1']
|
|
|
|
# will create groups nginx_master and nginx_v1
|
|
|
|
tags = true
|
|
|
|
|
|
|
|
# looks up the node name at the given path for a list of groups to which the
|
|
|
|
# node should be added.
|
|
|
|
kv_groups=ansible/groups
|
|
|
|
|
|
|
|
# looks up the node name at the given path for a json dictionary of metadata that
|
|
|
|
# should be attached as metadata for the node
|
|
|
|
kv_metadata=ansible/metadata
|
|
|
|
|
|
|
|
# looks up the health of each service and adds the node to 'up' and 'down' groups
|
2018-09-21 20:56:35 +02:00
|
|
|
# based on the service availability
|
2017-12-13 14:33:28 +01:00
|
|
|
#
|
|
|
|
# !!!! if availability is true, suffixes also must be true. !!!!
|
|
|
|
#
|
2015-01-24 02:09:03 +01:00
|
|
|
availability = true
|
|
|
|
available_suffix = _up
|
|
|
|
unavailable_suffix = _down
|