Fixes #4: Clean up role / coding standards, etc.

master
Jeff Geerling 2015-10-05 07:30:56 -04:00
parent 9ab3a65c0d
commit 6ba30a9f6c
4 changed files with 26 additions and 18 deletions

View File

@ -69,7 +69,7 @@ None.
- hosts: servers
roles:
- { role: geerlingguy.munin }
- geerlingguy.munin
## License

View File

@ -1,2 +0,0 @@
---
# TODO

View File

@ -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

View File

@ -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: