This commit is contained in:
parent
4ddd0a26cd
commit
f380ffb4a0
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
systemd:
|
systemd:
|
||||||
confdir: /etc/systemd
|
confdir: /etc/systemd
|
||||||
config:
|
settings: {}
|
||||||
|
moduleconfig:
|
||||||
journald:
|
journald:
|
||||||
Journal:
|
Journal:
|
||||||
Storage: auto
|
Storage: auto
|
||||||
|
@ -1,43 +1,5 @@
|
|||||||
---
|
---
|
||||||
{%- from "systemd/map.jinja" import systemd with context %}
|
include:
|
||||||
{% for module,settings in systemd.config.items() %}
|
- .system
|
||||||
systemd-confdir-{{ module }}:
|
- .preset
|
||||||
file.directory:
|
- .module
|
||||||
- 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 %}
|
|
||||||
|
24
states/systemd/module.sls
Normal file
24
states/systemd/module.sls
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
{%- from "systemd/map.jinja" import systemd with context %}
|
||||||
|
{% for module, settings in systemd.moduleconfig.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 %}
|
20
states/systemd/preset.sls
Normal file
20
states/systemd/preset.sls
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
{%- from "systemd/map.jinja" import systemd with context %}
|
||||||
|
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 %}
|
16
states/systemd/system.sls
Normal file
16
states/systemd/system.sls
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
{%- from "systemd/map.jinja" import systemd with context %}
|
||||||
|
systemd-confdir-system:
|
||||||
|
file.directory:
|
||||||
|
- name: {{ systemd.confdir }}/system.conf.d/
|
||||||
|
|
||||||
|
systemd-configfile-system:
|
||||||
|
file.managed:
|
||||||
|
- name: {{ systemd.confdir }}/system.conf.d/custom.conf
|
||||||
|
- source: salt://systemd/templates/systemd_custom.conf.j2
|
||||||
|
- template: jinja
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- mode: 0644
|
||||||
|
- context:
|
||||||
|
settings: {{ systemd.settings }}
|
Loading…
Reference in New Issue
Block a user