Updated the Munin node config for FreeBSD
This commit is contained in:
parent
4c7d1d4f4e
commit
0e018836f3
4
munin/defaults.yaml
Normal file
4
munin/defaults.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
munin:
|
||||||
|
file_user: root
|
||||||
|
file_group: root
|
||||||
|
|
@ -1,4 +1,7 @@
|
|||||||
{% set munin_master = salt['grains.filter_by']({
|
{## Start with defaults from defaults.sls ##}
|
||||||
|
{% import_yaml 'munin/defaults.yaml' as default_settings %}
|
||||||
|
|
||||||
|
{% set munin_master_settings = salt['grains.filter_by']({
|
||||||
'Debian': {
|
'Debian': {
|
||||||
'package': 'munin',
|
'package': 'munin',
|
||||||
'config': '/etc/munin/munin.conf',
|
'config': '/etc/munin/munin.conf',
|
||||||
@ -26,9 +29,19 @@
|
|||||||
'config': '/etc/munin/munin.conf',
|
'config': '/etc/munin/munin.conf',
|
||||||
'config_src': 'salt://munin/files/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')) %}
|
}, merge=salt['pillar.get']('munin:lookup:master')) %}
|
||||||
|
|
||||||
{% set munin_node = salt['grains.filter_by']({
|
{% set munin_master = default_settings.copy() %}
|
||||||
|
{% munin_master.update(munin_master_settings %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set munin_node_settings = salt['grains.filter_by']({
|
||||||
'Debian': {
|
'Debian': {
|
||||||
'package': 'munin-node',
|
'package': 'munin-node',
|
||||||
'service': 'munin-node',
|
'service': 'munin-node',
|
||||||
@ -64,9 +77,21 @@
|
|||||||
'config_src': 'salt://munin/files/munin-node.conf',
|
'config_src': 'salt://munin/files/munin-node.conf',
|
||||||
'plugin_dir': '/usr/libexec/munin/plugins',
|
'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')) %}
|
}, merge=salt['pillar.get']('munin:lookup:node')) %}
|
||||||
|
|
||||||
{% set net_ssleay = salt['grains.filter_by']({
|
{% set munin_node = default_settings.copy() %}
|
||||||
|
{% munin_node.update(munin_node_settings %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set net_ssleay_settings = salt['grains.filter_by']({
|
||||||
'Debian': {
|
'Debian': {
|
||||||
'package': 'libnet-ssleay-perl',
|
'package': 'libnet-ssleay-perl',
|
||||||
},
|
},
|
||||||
@ -76,9 +101,16 @@
|
|||||||
'Gentoo': {
|
'Gentoo': {
|
||||||
'package': 'dev-perl/Net-SSLeay',
|
'package': 'dev-perl/Net-SSLeay',
|
||||||
},
|
},
|
||||||
|
'FreeBSD': {
|
||||||
|
'package': 'perl-Net-SSLeay',
|
||||||
|
},
|
||||||
}, merge=salt['pillar.get']('net_ssleay:lookup')) %}
|
}, merge=salt['pillar.get']('net_ssleay:lookup')) %}
|
||||||
|
|
||||||
{% set munin_tls = salt['grains.filter_by']({
|
{% set munin_ssleay = default_settings.copy() %}
|
||||||
|
{% munin_ssleay.update(munin_ssleay_settings %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set munin_tls_settings = salt['grains.filter_by']({
|
||||||
'Debian': {
|
'Debian': {
|
||||||
'private_key': '/etc/munin/tls/key.pem',
|
'private_key': '/etc/munin/tls/key.pem',
|
||||||
'certificate': '/etc/munin/tls/crt.pem',
|
'certificate': '/etc/munin/tls/crt.pem',
|
||||||
@ -94,4 +126,13 @@
|
|||||||
'certificate': '/etc/munin/tls/crt.pem',
|
'certificate': '/etc/munin/tls/crt.pem',
|
||||||
'ca_certificate': '/etc/munin/tls/cacert.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')) %}
|
}, merge=salt['pillar.get']('munin:lookup:tls')) %}
|
||||||
|
|
||||||
|
{% set munin_tls = default_settings.copy() %}
|
||||||
|
{% munin_tls.update(munin_tls_settings %}
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ munin_node_config:
|
|||||||
- name: {{ munin_node.config }}
|
- name: {{ munin_node.config }}
|
||||||
- source: {{ munin_node.config_src }}
|
- source: {{ munin_node.config_src }}
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- user: root
|
- user: {{ munin_node.file_user }}
|
||||||
- group: root
|
- group: {{ munin_node.file_group }}
|
||||||
- mode: 644
|
- mode: 644
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: munin_node
|
- service: munin_node
|
||||||
|
@ -5,11 +5,11 @@ include:
|
|||||||
|
|
||||||
# Enable common plugins
|
# Enable common plugins
|
||||||
{% for plugin, linked_file in pillar.get('munin_node_common_plugins', {}).items() %}
|
{% for plugin, linked_file in pillar.get('munin_node_common_plugins', {}).items() %}
|
||||||
/etc/munin/plugins/{{ plugin }}:
|
{{ munin_node.plugin_dir }}/{{ plugin }}:
|
||||||
file.symlink:
|
file.symlink:
|
||||||
- target: {{ munin_node.plugin_dir}}/{{ linked_file }}
|
- target: {{ munin_node.plugin_dir}}/{{ linked_file }}
|
||||||
- user: root
|
- user: {{ munin_node.file_user }}
|
||||||
- group: root
|
- group: {{ munin_node.file_group }}
|
||||||
- mode: 755
|
- mode: 755
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
@ -17,11 +17,11 @@ include:
|
|||||||
{% for hostname, plugin in salt['pillar.get']('munin_node_specific_plugins', {}).items() %}
|
{% for hostname, plugin in salt['pillar.get']('munin_node_specific_plugins', {}).items() %}
|
||||||
{% if salt['pillar.get']('munin_node:host_name') == hostname %}
|
{% if salt['pillar.get']('munin_node:host_name') == hostname %}
|
||||||
{% for plugin_name, linked_file in plugin.items() %}
|
{% for plugin_name, linked_file in plugin.items() %}
|
||||||
/etc/munin/plugins/{{ plugin_name }}:
|
{{ munin_node.plugin_dir }}/{{ plugin_name }}:
|
||||||
file.symlink:
|
file.symlink:
|
||||||
- target: {{ munin_node.plugin_dir}}/{{ linked_file }}
|
- target: {{ munin_node.plugin_dir}}/{{ linked_file }}
|
||||||
- user: root
|
- user: {{ munin_node.file_user }}
|
||||||
- group: root
|
- group: {{ munin_node.file_group }}
|
||||||
- mode: 755
|
- mode: 755
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -30,4 +30,4 @@ include:
|
|||||||
{{ munin_node.service }}:
|
{{ munin_node.service }}:
|
||||||
service.running:
|
service.running:
|
||||||
- watch:
|
- watch:
|
||||||
- file: /etc/munin/plugins/*
|
- file: {{ munin_node.plugin_dir }}/*
|
||||||
|
Loading…
Reference in New Issue
Block a user