2018-02-01 16:32:44 -05:00
|
|
|
# -*- 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',
|
|
|
|
},
|
2017-11-02 08:46:21 -04:00
|
|
|
'FreeBSD': {
|
|
|
|
'package': 'munin-master',
|
|
|
|
'config': '/usr/local/etc/munin/munin.conf',
|
|
|
|
'file_group': 'wheel',
|
|
|
|
},
|
2018-02-01 16:32:44 -05:00
|
|
|
}, 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': {
|
2017-11-02 10:40:58 -04:00
|
|
|
'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',
|
2017-11-02 10:40:58 -04:00
|
|
|
'plugin_target_dir': '/usr/libexec/munin/plugins',
|
2015-12-02 17:31:37 -05:00
|
|
|
},
|
2017-11-02 08:46:21 -04:00
|
|
|
'FreeBSD': {
|
|
|
|
'config': '/usr/local/etc/munin/munin-node.conf',
|
|
|
|
'plugin_dir': '/usr/local/etc/munin/plugins',
|
2017-11-02 10:40:58 -04:00
|
|
|
'plugin_target_dir': '/usr/local/share/munin/plugins',
|
2017-11-02 08:46:21 -04:00
|
|
|
'file_group': 'wheel',
|
|
|
|
},
|
2018-02-01 16:32:44 -05:00
|
|
|
}, grain='os_family') %}
|
2014-01-06 01:34:51 -05:00
|
|
|
|
2018-03-31 23:24:47 -04:00
|
|
|
{% set net_ssleay_osmap = salt['grains.filter_by']({
|
2014-01-06 01:34:51 -05:00
|
|
|
'Debian': {
|
|
|
|
'package': 'libnet-ssleay-perl',
|
|
|
|
},
|
2018-03-31 23:32:11 -04:00
|
|
|
'Arch': {
|
|
|
|
'package': 'perl-net-ssleay',
|
2014-01-06 01:34:51 -05:00
|
|
|
},
|
2015-12-02 17:37:05 -05:00
|
|
|
'Gentoo': {
|
|
|
|
'package': 'dev-perl/Net-SSLeay',
|
|
|
|
},
|
2018-02-01 16:32:44 -05:00
|
|
|
}, grain='os_family') %}
|
2014-01-06 20:38:14 -05:00
|
|
|
|
2018-03-31 23:24:47 -04:00
|
|
|
{% set munin_tls_osmap = salt['grains.filter_by']({
|
2017-11-02 08:46:21 -04:00
|
|
|
'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-02-01 16:32:44 -05:00
|
|
|
}, grain='os_family') %}
|
|
|
|
|
|
|
|
{## Merge osmaps into defaults, then marge in pillar ##}
|
|
|
|
{% do default_settings.munin_master.update(munin_master_osmap) %}
|
2018-03-31 23:16:01 -04:00
|
|
|
{% set munin_master = salt['pillar.get']('munin:lookup:munin_master', default=default_settings.munin_master, merge=True) %}
|
2018-02-01 16:32:44 -05:00
|
|
|
{% do default_settings.munin_node.update(munin_node_osmap) %}
|
2018-03-31 23:16:01 -04:00
|
|
|
{% 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) %}
|
2018-03-31 23:16:01 -04:00
|
|
|
{% set net_ssleay = salt['pillar.get']('munin:lookup:munin_ssleay', default=default_settings.net_ssleay, merge=True) %}
|
2018-02-01 16:32:44 -05:00
|
|
|
{% do default_settings.munin_tls.update(munin_tls_osmap) %}
|
2018-03-31 23:16:01 -04:00
|
|
|
{% set munin_tls = salt['pillar.get']('munin:lookup:munin_tls', default=default_settings.munin_tls, merge=True) %}
|
2018-02-01 16:32:44 -05:00
|
|
|
|