paulbsd-salt/states/systemd/init.sls
Paul Lecuq 530f1f4009
All checks were successful
continuous-integration/drone/push Build is passing
updated systemd state
2024-09-25 21:21:55 +02:00

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 %}