{## Start with defaults from defaults.sls ##} {% import_yaml 'munin/defaults.yaml' as default_settings %} {% set munin_master_settings = salt['grains.filter_by']({ 'Debian': { 'package': 'munin', 'config': '/etc/munin/munin.conf', 'config_src': 'salt://munin/files/munin.conf', }, 'RedHat': { 'package': 'munin', 'config': '/etc/munin/munin.conf', 'config_src': 'salt://munin/files/munin.conf', }, 'Suse': { 'package': 'munin', 'config': '/etc/munin/munin.conf', 'config_src': 'salt://munin/files/munin.conf', }, 'Arch': { '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', }, 'Gentoo': { 'package': 'net-analyzer/munin', 'config': '/etc/munin/munin.conf', 'config_src': 'salt://munin/files/munin.conf', }, 'FreeBSD': { 'package': 'munin-master', 'config': '/usr/local/etc/munin/munin.conf', 'config_src': 'salt://munin/files/munin.conf', 'file_group': 'wheel', }, }, merge=salt['pillar.get']('munin:lookup:master')) %} {% set munin_master = default_settings.copy() %} {% munin_master.update(munin_master_settings %} {% set munin_node_settings = salt['grains.filter_by']({ 'Debian': { 'package': 'munin-node', 'service': 'munin-node', 'config': '/etc/munin/munin-node.conf', 'config_src': 'salt://munin/files/munin-node.conf', 'plugin_dir': '/usr/share/munin/plugins', }, 'RedHat': { 'package': 'munin-node', 'service': 'munin-node', 'config': '/etc/munin/munin-node.conf', 'config_src': 'salt://munin/files/munin-node.conf', 'plugin_dir': '/usr/share/munin/plugins', }, 'Suse': { 'package': 'munin-node', 'service': 'munin-node', 'config': '/etc/munin/munin-node.conf', 'config_src': 'salt://munin/files/munin-node.conf', 'plugin_dir': '/usr/share/munin/plugins', }, 'Arch': { 'package': 'munin-node', 'service': 'munin-node', 'config': '/etc/munin/munin-node.conf', 'config_src': 'salt://munin/files/munin-node.conf', 'plugin_dir': '/usr/lib/munin/plugins', }, 'Gentoo': { 'package': 'net-analyzer/munin', 'service': 'munin-node', 'config': '/etc/munin/munin-node.conf', 'config_src': 'salt://munin/files/munin-node.conf', 'plugin_dir': '/usr/libexec/munin/plugins', }, 'FreeBSD': { 'package': 'munin-node', 'service': 'munin-node', 'config': '/usr/local/etc/munin/munin-node.conf', 'config_src': 'salt://munin/files/munin-node.conf', 'plugin_dir': '/usr/local/etc/munin/plugins', 'file_group': 'wheel', }, }, merge=salt['pillar.get']('munin:lookup:node')) %} {% set munin_node = default_settings.copy() %} {% munin_node.update(munin_node_settings %} {% set net_ssleay_settings = salt['grains.filter_by']({ 'Debian': { 'package': 'libnet-ssleay-perl', }, 'RedHat': { 'package': 'perl-Net-SSLeay', }, 'Gentoo': { 'package': 'dev-perl/Net-SSLeay', }, 'FreeBSD': { 'package': 'perl-Net-SSLeay', }, }, merge=salt['pillar.get']('net_ssleay:lookup')) %} {% set munin_ssleay = default_settings.copy() %} {% munin_ssleay.update(munin_ssleay_settings %} {% set munin_tls_settings = salt['grains.filter_by']({ 'Debian': { 'private_key': '/etc/munin/tls/key.pem', 'certificate': '/etc/munin/tls/crt.pem', 'ca_certificate': '/etc/munin/tls/cacert.pem', }, 'RedHat': { 'private_key': '/etc/munin/tls/key.pem', 'certificate': '/etc/munin/tls/crt.pem', 'ca_certificate': '/etc/munin/tls/cacert.pem', }, 'Gentoo': { 'private_key': '/etc/munin/tls/key.pem', 'certificate': '/etc/munin/tls/crt.pem', 'ca_certificate': '/etc/munin/tls/cacert.pem', }, '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', }, }, merge=salt['pillar.get']('munin:lookup:tls')) %} {% set munin_tls = default_settings.copy() %} {% munin_tls.update(munin_tls_settings %}