install plugins on icinga master
This commit is contained in:
@@ -1,48 +1,3 @@
|
||||
|
||||
# A deploy key must be added for this to work!
|
||||
/usr/local/lib/nagios:
|
||||
git.cloned:
|
||||
- name: {{ salt.pillar.get("icinga2:monitoring_plugins_git_url") | yaml_encode }}
|
||||
- target: /usr/local/lib/nagios
|
||||
- branch: master
|
||||
- user: root
|
||||
|
||||
|
||||
/usr/local/lib/nagios/venv:
|
||||
cmd.run:
|
||||
{% if 'inmotionhosting' in grains.fqdn %}
|
||||
- name: imh-python3 -m venv /usr/local/lib/nagios/venv
|
||||
{% else %}
|
||||
- name: python3 -m venv /usr/local/lib/nagios/venv
|
||||
{% endif %}
|
||||
- creates: /usr/local/lib/nagios/venv
|
||||
- require:
|
||||
- git: /usr/local/lib/nagios
|
||||
- pkg: monitoring_packages
|
||||
|
||||
# TODO: make all this venv stuff a cmd.script
|
||||
|
||||
venv-ensurepip:
|
||||
cmd.run:
|
||||
- name: /usr/local/lib/nagios/venv/bin/python3 -m ensurepip
|
||||
- creates: /usr/local/lib/nagios/venv/bin/pip3
|
||||
- require:
|
||||
- cmd: /usr/local/lib/nagios/venv
|
||||
|
||||
venv-psutil:
|
||||
cmd.run:
|
||||
- name: /usr/local/lib/nagios/venv/bin/pip3 install psutil
|
||||
- require:
|
||||
- cmd: venv-ensurepip
|
||||
|
||||
monitoring_packages:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
- smartmontools
|
||||
{% if grains.os_family == 'Debian' %}
|
||||
- python3-venv
|
||||
{% endif %}
|
||||
|
||||
icinga:
|
||||
user.present:
|
||||
- shell: /bin/bash
|
||||
|
||||
Reference in New Issue
Block a user