munin-formula/munin/map.jinja

69 lines
2.4 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',
},
}, grain='os_family') %}
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',
},
}, grain='os_family') %}
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',
},
}, grain='os_family') %}
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',
},
}, grain='os_family') %}
{## Merge osmaps into defaults, then marge in pillar ##}
{% do default_settings.munin_master.update(munin_master_osmap) %}
{% set munin_master = salt['pillar.get']('munin:lookup:munin_master', default=default_settings.munin_master, merge=True) %}
{% do default_settings.munin_node.update(munin_node_osmap) %}
{% set munin_node = salt['pillar.get']('munin:lookup:munin_node', default=default_settings.munin_node, merge=True) %}
2018-03-31 23:24:47 -04:00
{% do default_settings.net_ssleay.update(net_ssleay_osmap) %}
{% set net_ssleay = salt['pillar.get']('munin:lookup:munin_ssleay', default=default_settings.net_ssleay, merge=True) %}
{% do default_settings.munin_tls.update(munin_tls_osmap) %}
{% set munin_tls = salt['pillar.get']('munin:lookup:munin_tls', default=default_settings.munin_tls, merge=True) %}