diff --git a/.gitignore b/.gitignore index 98a3264..1c22cce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +files/plugins_custom/ + .*.sw? *~ diff --git a/defaults/main.yml b/defaults/main.yml index fd2495e..f27e065 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,8 @@ monitored_packages_additional: [] monitored_packages_additional_nrpe: [] monitored_packages_additional_ssh: [] +monitored_plugins_custom_path: /usr/local/plugins/ + monitored_nrpe_server_address: null monitored_nrpe_port: 5666 diff --git a/files/plugins_custom/.PUT_YOUR_OWN_PLUGINS_HERE b/files/plugins_custom/.PUT_YOUR_OWN_PLUGINS_HERE new file mode 100644 index 0000000..e69de29 diff --git a/tasks/main.yml b/tasks/main.yml index 4498cb7..f28a43c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -26,6 +26,10 @@ include_tasks: packages.yml when: monitored_packages_install != False +- name: "INCLUDE: Copy custom plugins" + include_tasks: plugins_custom.yml + when: monitored_plugins_custom|default([]) != [] + - name: "INCLUDE: Monitoring by NRPE" include_tasks: nrpe.yml when: monitored_by_nrpe == True diff --git a/tasks/plugins_custom.yml b/tasks/plugins_custom.yml new file mode 100644 index 0000000..6130dc3 --- /dev/null +++ b/tasks/plugins_custom.yml @@ -0,0 +1,11 @@ +--- +- name: Copy custom plugins + copy: + src: "plugins_custom/{{ item }}" + dest: "{{ monitored_plugins_custom_path }}" + owner: root + group: "{{ monitored_group }}" + mode: 0750 + with_items: "{{ monitored_plugins_custom }}" + +