paulbsd-salt/states/systemd/init.sls

25 lines
674 B
Plaintext
Raw Normal View History

2024-02-07 22:00:51 +01:00
---
{%- 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 %}