Merge pull request #10 from jamesp9/archlinux
archlinux: enable munin-cron as systemd timer
This commit is contained in:
commit
dbf95139e3
@ -27,6 +27,13 @@ Includes ``munin.master``.
|
||||
|
||||
Generates a config file for the munin master based on pillar data.
|
||||
|
||||
``munin.master.munin-cron``
|
||||
-----------------------
|
||||
|
||||
Includes ``munin.master``.
|
||||
|
||||
Archlinux only. Enable munin-cron via a systemd timer.
|
||||
|
||||
``munin.node``
|
||||
--------------
|
||||
|
||||
|
7
munin/files/Arch/munin-cron.service
Normal file
7
munin/files/Arch/munin-cron.service
Normal file
@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Munin Cron
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=munin
|
||||
ExecStart=/usr/bin/munin-cron
|
8
munin/files/Arch/munin-cron.timer
Normal file
8
munin/files/Arch/munin-cron.timer
Normal file
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Munin Cron Timer
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* *:00/5:00
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -13,6 +13,8 @@
|
||||
'package': 'munin',
|
||||
'config': '/etc/munin/munin.conf',
|
||||
'config_src': 'salt://munin/files/munin.conf',
|
||||
'cron_service': '/etc/systemd/system/munin-cron.service',
|
||||
'cron_timer': '/etc/systemd/system/munin-cron.timer',
|
||||
},
|
||||
}, merge=salt['pillar.get']('munin_master:lookup')) %}
|
||||
|
||||
|
30
munin/master/munin-cron.sls
Normal file
30
munin/master/munin-cron.sls
Normal file
@ -0,0 +1,30 @@
|
||||
{% from "munin/map.jinja" import munin_master with context %}
|
||||
|
||||
include:
|
||||
- munin.master
|
||||
|
||||
{% if salt['grains.get']('os_family') == 'Arch' %}
|
||||
cron_service:
|
||||
file.managed:
|
||||
- name: {{ munin_master.cron_service }}
|
||||
- source: salt://munin/files/Arch/munin-cron.service
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
|
||||
cron_timer:
|
||||
file.managed:
|
||||
- name: {{ munin_master.cron_timer }}
|
||||
- source: salt://munin/files/Arch/munin-cron.timer
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
|
||||
munin-cron.timer:
|
||||
service.running:
|
||||
- enable: True
|
||||
- watch:
|
||||
- file: cron_service
|
||||
- file: cron_timer
|
||||
|
||||
{% endif %}
|
Loading…
Reference in New Issue
Block a user