serialize for better json format
This commit is contained in:
parent
a30276a1dc
commit
d99c754f8d
1 changed files with 8 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
||||||
{% from slspath + "/map.jinja" import consul with context %}
|
{% from slspath + "/map.jinja" import consul with context %}
|
||||||
|
|
||||||
consul-config:
|
consul-config:
|
||||||
file.managed:
|
file.serialize:
|
||||||
- name: /etc/consul.d/config.json
|
- name: /etc/consul.d/config.json
|
||||||
{% if consul.service != False %}
|
{% if consul.service != False %}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
|
@ -11,8 +11,8 @@ consul-config:
|
||||||
- group: consul
|
- group: consul
|
||||||
- require:
|
- require:
|
||||||
- user: consul
|
- user: consul
|
||||||
- contents: |
|
- formatter: json
|
||||||
{{ consul.config | json }}
|
- dataset: {{ consul.config }}
|
||||||
|
|
||||||
{% for script in consul.scripts %}
|
{% for script in consul.scripts %}
|
||||||
consul-script-install-{{ loop.index }}:
|
consul-script-install-{{ loop.index }}:
|
||||||
|
@ -26,10 +26,8 @@ consul-script-install-{{ loop.index }}:
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
consul-script-config:
|
consul-script-config:
|
||||||
file.managed:
|
file.serialize:
|
||||||
- source: salt://{{ slspath }}/files/services.json
|
|
||||||
- name: /etc/consul.d/services.json
|
- name: /etc/consul.d/services.json
|
||||||
- template: jinja
|
|
||||||
{% if consul.service != False %}
|
{% if consul.service != False %}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: consul
|
- service: consul
|
||||||
|
@ -38,6 +36,6 @@ consul-script-config:
|
||||||
- group: consul
|
- group: consul
|
||||||
- require:
|
- require:
|
||||||
- user: consul
|
- user: consul
|
||||||
- context:
|
- formatter: json
|
||||||
register: |
|
- dataset:
|
||||||
{{ consul.register | json }}
|
services: {{ consul.register }}
|
||||||
|
|
Loading…
Reference in a new issue