41 lines
1.0 KiB
Plaintext
41 lines
1.0 KiB
Plaintext
# 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
|
|
|
|
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 %}
|