From 2f726642316ca15c959efecb56239f91721875ff Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Thu, 18 Mar 2021 23:20:50 +0000 Subject: [PATCH] munin-node: Add OpenBSD support --- roles/munin-node/handlers/main.yml | 2 +- roles/munin-node/tasks/main.yml | 8 ++++++-- roles/munin-node/templates/munin-node.conf.j2 | 2 +- roles/munin-node/vars/OpenBSD.yml | 6 ++++++ roles/munin-node/vars/RedHat.yml | 4 ++++ 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 roles/munin-node/vars/OpenBSD.yml create mode 100644 roles/munin-node/vars/RedHat.yml diff --git a/roles/munin-node/handlers/main.yml b/roles/munin-node/handlers/main.yml index 0b7f394..257442f 100644 --- a/roles/munin-node/handlers/main.yml +++ b/roles/munin-node/handlers/main.yml @@ -1,5 +1,5 @@ --- - name: restart munin-node service: - name: munin-node + name: "{{ munin_node_service }}" state: restarted diff --git a/roles/munin-node/tasks/main.yml b/roles/munin-node/tasks/main.yml index 0c7b87d..d1c8a24 100644 --- a/roles/munin-node/tasks/main.yml +++ b/roles/munin-node/tasks/main.yml @@ -1,8 +1,12 @@ --- +- name: include OS-specific variables + include_vars: "{{ ansible_os_family }}.yml" + - name: install packages package: - name: munin-node + name: "{{ item }}" state: installed + with_items: "{{ munin_node_packages }}" - name: create config template: @@ -15,6 +19,6 @@ - name: enable service service: - name: munin-node + name: "{{ munin_node_service }}" state: started enabled: true diff --git a/roles/munin-node/templates/munin-node.conf.j2 b/roles/munin-node/templates/munin-node.conf.j2 index 52bdac3..53c7b46 100644 --- a/roles/munin-node/templates/munin-node.conf.j2 +++ b/roles/munin-node/templates/munin-node.conf.j2 @@ -1,6 +1,6 @@ log_level 4 -log_file /var/log/munin-node/munin-node.log +log_file {{ munin_node_logfile }} pid_file /var/run/munin/munin-node.pid background 1 diff --git a/roles/munin-node/vars/OpenBSD.yml b/roles/munin-node/vars/OpenBSD.yml new file mode 100644 index 0000000..ce8d11c --- /dev/null +++ b/roles/munin-node/vars/OpenBSD.yml @@ -0,0 +1,6 @@ +--- +munin_node_logfile: /var/log/munin/munin-node.log +munin_node_service: munin_node +munin_node_packages: + - munin-node + - p5-Net-SSLeay diff --git a/roles/munin-node/vars/RedHat.yml b/roles/munin-node/vars/RedHat.yml new file mode 100644 index 0000000..02cfbe2 --- /dev/null +++ b/roles/munin-node/vars/RedHat.yml @@ -0,0 +1,4 @@ +--- +munin_node_logfile: /var/log/munin-node/munin-node.log +munin_node_service: munin-node +munin_node_packages: munin-node