First commit
This commit is contained in:
26
ansible/roles/consul/templates/config.json
Normal file
26
ansible/roles/consul/templates/config.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"log_level": "INFO",
|
||||
"node_name": "{{ ansible_hostname }}",
|
||||
"domain": "{{ consul_domain }}",
|
||||
"server": true,
|
||||
"key_file": "{{ consul_key_file }}",
|
||||
"cert_file": "{{ consul_cert_file }}",
|
||||
"ca_file": "{{ consul_ca_file }}",
|
||||
"verify_incoming": true,
|
||||
"verify_outgoing": true,
|
||||
"verify_server_hostname": true,
|
||||
"encrypt": "{{ consul_secret_key }}",
|
||||
"ui": true,
|
||||
"leave_on_terminate": true,
|
||||
"data_dir": "/opt/consul",
|
||||
"datacenter": "{{ consul_datacenter | mandatory }}",
|
||||
"client_addr": "{{ consul_client_addr }}",
|
||||
"bind_addr": "{{ consul_bind_addr }}",
|
||||
"advertise_addr": "{{ consul_advertise_addr }}",
|
||||
"bootstrap_expect": {{ consul_nodes | length }},
|
||||
"retry_join": ["{{ consul_nodes | join('", "') }}"],
|
||||
"enable_syslog": true,
|
||||
"performance": {
|
||||
"raft_multiplier": 1
|
||||
}
|
||||
}
|
||||
19
ansible/roles/consul/templates/consul.service
Normal file
19
ansible/roles/consul/templates/consul.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description="HashiCorp Consul - A service mesh solution"
|
||||
Documentation=https://www.consul.io/
|
||||
Requires=network-online.target
|
||||
After=network-online.target
|
||||
ConditionFileNotEmpty=/etc/consul/config.json
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=consul
|
||||
Group=consul
|
||||
ExecStart=/usr/local/bin/consul agent -config-file=/etc/consul/config.json
|
||||
ExecReload=/usr/local/bin/consul reload
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user