From c294dd2b97badf75056a339eb467b1ae4c37951c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 28 Oct 2018 14:24:53 -0400 Subject: [PATCH] Update main.yml --- roles/munin/tasks/main.yml | 39 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/roles/munin/tasks/main.yml b/roles/munin/tasks/main.yml index 9d983770f..558cfa3ce 100644 --- a/roles/munin/tasks/main.yml +++ b/roles/munin/tasks/main.yml @@ -1,29 +1,27 @@ -- name: Install Munin package (debuntu) +- name: Install 5 package for Munin (debuntu) package: - name: "{{ item }}" + name: + - munin + - munin-node + - munin-plugins-extra + - libcgi-fast-perl + - libapache2-mod-fcgid state: present - with_items: - - munin - - munin-node - - munin-plugins-extra - - libcgi-fast-perl - - libapache2-mod-fcgid tags: - download when: is_debuntu -- name: Install Munin package (OS's other than debuntu) +- name: Install packages munin and munin-node (OS's other than debuntu) package: - name: "{{ item }}" + name: + - munin + - munin-node state: present - with_items: - - munin - - munin-node tags: - download when: not is_debuntu -- name: Copy Munin config file +- name: Install /etc/munin/munin.conf and Apache's munin24.conf, from templates template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -34,7 +32,7 @@ - { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' } - { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' } -- name: Create admin user +- name: Establish username/password Admin/changeme in /etc/munin/munin-htpasswd htpasswd: path: /etc/munin/munin-htpasswd name: Admin @@ -49,21 +47,20 @@ state: started when: munin_enabled -- name: Enable Apache lookup (debuntu) +- name: Create symlink munin24.conf from sites-enabled to sites-available (debuntu) file: src: /etc/apache2/sites-available/munin24.conf - dest: /etc/apache2/sites-enabled/munin24.conf + path: /etc/apache2/sites-enabled/munin24.conf state: link when: munin_enabled and is_debuntu -- name: Disable Apache lookup (debuntu) +- name: Remove symlink munin24.conf in sites-enabled if not munin_enabled (debuntu) file: - src: /etc/apache2/sites-available/munin24.conf - dest: /etc/apache2/sites-enabled/munin24.conf + path: /etc/apache2/sites-enabled/munin24.conf state: absent when: not munin_enabled and is_debuntu -- name: Disable munin-node service when it becomes disabled +- name: Disable munin-node service if not munin_enabled service: name: munin-node enabled: no