43 lines
1 KiB
Text
43 lines
1 KiB
Text
{%- from slspath + '/map.jinja' import fabio with context -%}
|
|
|
|
fabio-config:
|
|
file.serialize:
|
|
- name: /etc/fabio/config.json
|
|
- formatter: json
|
|
- dataset: {{ fabio.config }}
|
|
- user: {{ fabio.user }}
|
|
- group: {{ fabio.group }}
|
|
- mode: 0640
|
|
- require:
|
|
- user: fabio-user
|
|
{%- if fabio.service %}
|
|
- watch_in:
|
|
- service: fabio
|
|
{%- endif %}
|
|
|
|
{% for script in fabio.scripts %}
|
|
fabio-script-install-{{ loop.index }}:
|
|
file.managed:
|
|
- source: {{ script.source }}
|
|
- name: {{ script.name }}
|
|
- template: jinja
|
|
- context: {{ script.get('context', {}) | yaml }}
|
|
- user: {{ fabio.user }}
|
|
- group: {{ fabio.group }}
|
|
- mode: 0755
|
|
{% endfor %}
|
|
|
|
fabio-script-config:
|
|
file.serialize:
|
|
- name: /etc/fabio.d/services.json
|
|
{% if fabio.service != False %}
|
|
- watch_in:
|
|
- service: fabio
|
|
{% endif %}
|
|
- user: {{ fabio.user }}
|
|
- group: {{ fabio.group }}
|
|
- require:
|
|
- user: fabio-user
|
|
- formatter: json
|
|
- dataset:
|
|
services: {{ fabio.register }}
|