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:
|
||||
server: false
|
||||
client: false
|
||||
service: false
|
||||
token: ""
|
||||
bootstrap: 1
|
||||
datacenter: "main"
|
||||
config:
|
||||
server: false
|
||||
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
|
||||
- group: consul
|
||||
|
||||
consul_common_config:
|
||||
consul_config:
|
||||
file.managed:
|
||||
- source: salt://consul/files/common.json
|
||||
- source: salt://consul/files/config.json
|
||||
- template: jinja
|
||||
- name: /etc/consul.d/common.json
|
||||
- name: /etc/consul.d/config.json
|
||||
{% if consul.service != False %}
|
||||
- watch_in:
|
||||
- service: consul
|
||||
|
@ -77,22 +77,6 @@ consul_common_config:
|
|||
- require:
|
||||
- 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 %}
|
||||
consul_service:
|
||||
service.running:
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
consul:
|
||||
server: true
|
||||
service: true
|
||||
token: "RIxqpNlOXqtr/j4BgvIMEw=="
|
||||
bootstrap: 3
|
||||
datacenter: "eu"
|
||||
config:
|
||||
server: true
|
||||
encrypt: "RIxqpNlOXqtr/j4BgvIMEw=="
|
||||
bootstrap: 3
|
||||
datacenter: eu
|
||||
bind_addr: 0.0.0.0
|
||||
|
|
Loading…
Reference in a new issue