Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add install external plugins #21

Merged
merged 4 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ This configuration will generate a configuration file at `/etc/munin/plugin-conf
env.regex bash
env.name bash

#### Install external plugins

You can install external plugins via `munin_node_install_plugins`.
Those plugins can be copied from local files or downloaded. For example:

munin_node_install_plugins: []
- src: files/munin/redis_
- remote_src: https://raw.githubusercontent.com/ohitz/phpfpm-multi-munin-plugin/master/phpfpm-multi


## Dependencies

None.
Expand Down
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ munin_node_plugins: []
# - name: ps_test
# plugin: ps_

# List of munin plugins to install.
munin_node_install_plugins: []
# - src: files/munin/redis_
# - remote_src: https://raw.githubusercontent.com/ohitz/phpfpm-multi-munin-plugin/master/phpfpm-multi

# Plugin configuration options (the key is the plugin heading, items within will
# be options for the plugin).
munin_node_config: {
Expand Down
18 changes: 18 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@
mode: 0644
notify: restart munin-node

- name: Install extra plugins.
copy:
src: "{{ item.src }}"
dest: "{{ munin_plugin_src_path }}{{ item.src | basename }}"
mode: '0755'
with_items: "{{ munin_node_install_plugins }}"
when: item.src is defined
notify: restart munin-node

- name: Install extra remote plugins.
get_url:
url: "{{ item.remote_src }}"
dest: "{{ munin_plugin_src_path }}{{ item.remote_src | basename }}"
mode: '0755'
with_items: "{{ munin_node_install_plugins }}"
when: item.remote_src is defined
notify: restart munin-node

- name: Enable additional plugins.
file: # noqa 208
path: "{{ munin_plugin_dest_path }}{{ item.name }}"
Expand Down