From 6ba30a9f6c70fb2430ed0dfce581ed58de4fb0e9 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 5 Oct 2015 07:30:56 -0400 Subject: [PATCH] Fixes #4: Clean up role / coding standards, etc. --- README.md | 2 +- handlers/main.yml | 2 -- meta/main.yml | 8 +++++++- tasks/main.yml | 32 ++++++++++++++++++-------------- 4 files changed, 26 insertions(+), 18 deletions(-) delete mode 100644 handlers/main.yml diff --git a/README.md b/README.md index a5c6ed7..9585e1b 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ None. - hosts: servers roles: - - { role: geerlingguy.munin } + - geerlingguy.munin ## License diff --git a/handlers/main.yml b/handlers/main.yml deleted file mode 100644 index 9fa4d47..0000000 --- a/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# TODO diff --git a/meta/main.yml b/meta/main.yml index 51e8d5e..ffadf38 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -3,7 +3,7 @@ dependencies: [] galaxy_info: author: geerlingguy - description: Munin monitoring server for RedHat/CentOS. + description: Munin monitoring server for RedHat/CentOS or Debian/Ubuntu. company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" min_ansible_version: 1.4 @@ -11,6 +11,12 @@ galaxy_info: - name: EL versions: - all + - name: Debian + versions: + - all + - name: Ubuntu + versions: + - all categories: - monitoring - system diff --git a/tasks/main.yml b/tasks/main.yml index d4ab9f2..a21d840 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,31 +3,35 @@ include_vars: "{{ ansible_os_family }}.yml" - name: Install required packages for munin (RedHat). - yum: "pkg={{ item }} state=installed" + yum: "name={{ item }} state=present" with_items: munin_packages when: ansible_os_family == 'RedHat' - name: Install required packages for munin (Debian). - apt: "pkg={{ item }} state=installed" + apt: "name={{ item }} state=present" with_items: munin_packages when: ansible_os_family == 'Debian' - name: Copy munin configurations. - template: > - src={{ item.src }} - dest={{ item.dest }} - owner=root group=root mode=644 + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: root + group: root + mode: 0644 with_items: - - { src: munin.conf.j2, dest: /etc/munin/munin.conf } - - { src: hosts.conf.j2, dest: "{{ munin_conf_d_directory }}/hosts.conf" } + - src: munin.conf.j2 + dest: /etc/munin/munin.conf + - src: hosts.conf.j2 + dest: "{{ munin_conf_d_directory }}/hosts.conf" - name: Create munin user via htpasswd. - htpasswd: > - create=yes - name={{ munin_admin_user }} - password={{ munin_admin_password }} - path=/etc/munin/munin-htpasswd - state=present + htpasswd: + create: yes + name: "{{ munin_admin_user }}" + password: "{{ munin_admin_password }}" + path: /etc/munin/munin-htpasswd + state: present - name: Enable or disable the munin cron job. lineinfile: