44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
---
|
|
{%- from "systemd/map.jinja" import systemd with context %}
|
|
{% for module,settings in systemd.config.items() %}
|
|
systemd-confdir-{{ module }}:
|
|
file.directory:
|
|
- name: {{ systemd.confdir }}/{{ module }}.conf.d/
|
|
|
|
systemd-configfile-{{ module }}:
|
|
file.managed:
|
|
- name: {{ systemd.confdir }}/{{ module }}.conf.d/custom.conf
|
|
- source: salt://systemd/templates/systemd_custom.conf.j2
|
|
- template: jinja
|
|
- user: root
|
|
- group: root
|
|
- mode: 0644
|
|
- context:
|
|
settings: {{ settings }}
|
|
|
|
systemd-service-{{ module }}:
|
|
service.running:
|
|
- name: systemd-{{ module }}
|
|
- watch:
|
|
- file: systemd-configfile-{{ module }}
|
|
{% endfor %}
|
|
|
|
system-preset-main-dir:
|
|
file.directory:
|
|
- name: {{ systemd.confdir }}/system-preset
|
|
|
|
{% for name, preset in systemd.presets.items() %}
|
|
systemd-preset-{{ name }}:
|
|
file.managed:
|
|
- name: {{ systemd.confdir }}/system-preset/00-{{ name }}.preset
|
|
- source: salt://systemd/templates/preset.j2
|
|
- template: jinja
|
|
- user: root
|
|
- group: root
|
|
- mode: 0644
|
|
- context:
|
|
preset: {{ preset }}
|
|
- require:
|
|
- file: {{ systemd.confdir }}/system-preset
|
|
{% endfor %}
|