Make config generic
This commit is contained in:
parent
cabb7cc309
commit
767274fd64
6 changed files with 19 additions and 40 deletions
|
@ -1,7 +1,10 @@
|
||||||
consul:
|
consul:
|
||||||
server: false
|
|
||||||
client: false
|
|
||||||
service: false
|
service: false
|
||||||
token: ""
|
config:
|
||||||
bootstrap: 1
|
server: false
|
||||||
datacenter: "main"
|
bind_addr: 0.0.0.0
|
||||||
|
data_dir: /var/consul
|
||||||
|
ui_dir: /opt/consul/dist
|
||||||
|
enable_debug: false
|
||||||
|
log_level: info
|
||||||
|
encrypt: ""
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"data_dir": "/var/consul",
|
|
||||||
"ui_dir": "/opt/consul/dist",
|
|
||||||
"enable_debug": true,
|
|
||||||
"log_level": "info",
|
|
||||||
"encrypt": "{{ salt['pillar.get']('consul:token') }}"
|
|
||||||
}
|
|
2
consul/files/config.json
Normal file
2
consul/files/config.json
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{% from "consul/map.jinja" import consul with context %}
|
||||||
|
{{ consul.config | json}}
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"server": true,
|
|
||||||
"bootstrap_expect": {{ salt['pillar.get']('consul:bootstrap') }},
|
|
||||||
"datacenter": "{{ salt['pillar.get']('consul:datacenter') }}"
|
|
||||||
}
|
|
|
@ -63,11 +63,11 @@ consul_data_dir:
|
||||||
- user: consul
|
- user: consul
|
||||||
- group: consul
|
- group: consul
|
||||||
|
|
||||||
consul_common_config:
|
consul_config:
|
||||||
file.managed:
|
file.managed:
|
||||||
- source: salt://consul/files/common.json
|
- source: salt://consul/files/config.json
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- name: /etc/consul.d/common.json
|
- name: /etc/consul.d/config.json
|
||||||
{% if consul.service != False %}
|
{% if consul.service != False %}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: consul
|
- service: consul
|
||||||
|
@ -77,22 +77,6 @@ consul_common_config:
|
||||||
- require:
|
- require:
|
||||||
- user: consul
|
- user: consul
|
||||||
|
|
||||||
{% if consul.server != False %}
|
|
||||||
consul_server_config:
|
|
||||||
file.managed:
|
|
||||||
- source: salt://consul/files/server.json
|
|
||||||
- name: /etc/consul.d/server.json
|
|
||||||
- template: jinja
|
|
||||||
{% if consul.service != False %}
|
|
||||||
- watch_in:
|
|
||||||
- service: consul
|
|
||||||
{% endif %}
|
|
||||||
- user: consul
|
|
||||||
- group: consul
|
|
||||||
- require:
|
|
||||||
- user: consul
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if consul.service != False %}
|
{% if consul.service != False %}
|
||||||
consul_service:
|
consul_service:
|
||||||
service.running:
|
service.running:
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
consul:
|
consul:
|
||||||
server: true
|
|
||||||
service: true
|
service: true
|
||||||
token: "RIxqpNlOXqtr/j4BgvIMEw=="
|
config:
|
||||||
bootstrap: 3
|
server: true
|
||||||
datacenter: "eu"
|
encrypt: "RIxqpNlOXqtr/j4BgvIMEw=="
|
||||||
|
bootstrap: 3
|
||||||
|
datacenter: eu
|
||||||
|
bind_addr: 0.0.0.0
|
||||||
|
|
Loading…
Reference in a new issue