munin-formula/munin/map.jinja

64 lines
2.2 KiB
Plaintext
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: ft=jinja
{## Start with default values from defaults.yaml ##}
{% import_yaml 'munin/defaults.yaml' as default_settings %}
{## Set OS-specific values for each of the states ##}
{% set munin_master_osmap = salt['grains.filter_by']({
2015-09-10 15:29:46 -04:00
'Arch': {
2015-11-28 23:50:33 -05:00
'cron_service': '/etc/systemd/system/munin-cron.service',
'cron_timer': '/etc/systemd/system/munin-cron.timer',
2015-09-10 15:29:46 -04:00
},
2015-12-02 17:31:37 -05:00
'Gentoo': {
'package': 'net-analyzer/munin',
},
'FreeBSD': {
'package': 'munin-master',
'config': '/usr/local/etc/munin/munin.conf',
'file_group': 'wheel',
},
2018-03-31 23:45:03 -04:00
}, grain='os_family', salt['pillar.get']('munin:lookup:munin_master')) %}
2014-01-05 00:47:26 -05:00
2018-03-31 23:24:47 -04:00
{% set munin_node_osmap = salt['grains.filter_by']({
2015-09-10 15:29:46 -04:00
'Arch': {
'plugin_target_dir': '/usr/lib/munin/plugins',
2015-09-10 15:29:46 -04:00
},
2015-12-02 17:31:37 -05:00
'Gentoo': {
'package': 'net-analyzer/munin',
'plugin_target_dir': '/usr/libexec/munin/plugins',
2015-12-02 17:31:37 -05:00
},
'FreeBSD': {
'config': '/usr/local/etc/munin/munin-node.conf',
'plugin_dir': '/usr/local/etc/munin/plugins',
'plugin_target_dir': '/usr/local/share/munin/plugins',
'file_group': 'wheel',
},
2018-03-31 23:45:03 -04:00
}, grain='os_family', salt['pillar.get']('munin:lookup:munin_node')) %}
2018-03-31 23:24:47 -04:00
{% set net_ssleay_osmap = salt['grains.filter_by']({
'Debian': {
'package': 'libnet-ssleay-perl',
},
2018-03-31 23:32:11 -04:00
'Arch': {
'package': 'perl-net-ssleay',
},
2015-12-02 17:37:05 -05:00
'Gentoo': {
'package': 'dev-perl/Net-SSLeay',
},
2018-03-31 23:45:03 -04:00
}, grain='os_family', salt['pillar.get']('munin:lookup:net_ssleay')) %}
2018-03-31 23:24:47 -04:00
{% set munin_tls_osmap = salt['grains.filter_by']({
'FreeBSD': {
'private_key': '/usr/local/etc/munin/tls/key.pem',
'certificate': '/usr/local/etc/munin/tls/crt.pem',
'ca_certificate': '/usr/local/etc/munin/tls/cacert.pem',
},
2018-03-31 23:45:03 -04:00
}, grain='os_family', salt['pillar.get']('munin:lookup:munin_tls')) %}
{## Merge osmaps into defaults, then marge in pillar ##}
2018-03-31 23:45:03 -04:00
{% set munin_master = default_settings.munin_master.update(munin_master_osmap) %}
{% set munin_node = default_settings.munin_node.update(munin_node_osmap) %}
{% set net_ssleay = default_settings.net_ssleay.update(net_ssleay_osmap) %}
{% set munin_tls = default_settings.munin_tls.update(munin_tls_osmap) %}