paulbsd-salt/states/systemd/init.sls

44 lines
1.1 KiB
Plaintext
Raw Permalink 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 %}
2024-09-25 21:21:55 +02:00
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 %}