Added additional directories

This commit is contained in:
Eric Renfro 2019-05-08 11:08:45 -04:00
parent 056a450ad0
commit 5ee01ee3de
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -36,6 +36,18 @@
{%- for svc, svc_parameters in parameters.get('services', {}).iteritems() %} {%- for svc, svc_parameters in parameters.get('services', {}).iteritems() %}
{%- if svc_parameters.get('enabled', False) %} {%- if svc_parameters.get('enabled', False) %}
{%- for svc_directory in svc_parameters.get('directories', []) %}
{{ exporter }}_{{ svc }}_{{ svc_directory.replace('/', '_') }}_exporter_directories:
file.directory:
- name: {{ svc_directory }}
- user: {{ svc_parameters.get('user', 'root') }}
- group: {{ svc_parameters.get('group', 'root') }}
- makedirs: True
- require_in:
- file: {{ exporter }}_{{ svc }}_exporter_systemd_unit
- service: {{ exporter }}_{{ svc }}_exporter_service
{%- endfor %}
{{ exporter }}_{{ svc }}_exporter_systemd_unit: {{ exporter }}_{{ svc }}_exporter_systemd_unit:
file.managed: file.managed:
- name: /etc/systemd/system/{{ svc }}.service - name: /etc/systemd/system/{{ svc }}.service