Add Munin async server role

This commit is contained in:
Nemo 2020-07-10 22:32:32 +02:00
parent db893b5291
commit 0793b81000
10 changed files with 121 additions and 0 deletions

View file

@ -7,6 +7,10 @@ vault_public_key_<USER>: |
vault_munin_admin_user: munin
vault_munin_admin_password: munin
vault_private_key_munin_async_user_host: |
SSH_PRIV_KEY_OF_munin_async_user_USER_ON_USER_HOST
vault_public_key_munin_async_user_host: SSH_PUB_KEY_OF_munin_async_user_USER_ON_USER_HOST
vault_private_key_backup_user_host: |
SSH_PRIV_KEY_OF_backup_user_USER_ON_USER_HOST
vault_public_key_backup_user_host: SSH_PUBKEY_OF_backup_user_USER_ON_BACKUP_HOST

View file

@ -9,4 +9,7 @@ munin_hosts:
munin_admin_user: "{{ vault_munin_admin_user }}"
munin_admin_password: "{{ vault_munin_admin_password }}"
private_key_munin_async_user_host: "{{ vault_private_key_munin_async_user_host }}"
public_key_munin_async_user_host: "{{ vault_public_key_munin_async_user_host }}"
munin_alerts: []

View file

@ -2,3 +2,4 @@
- hosts: munin_server
roles:
- geerlingguy.munin
- munin_async_server

View file

@ -0,0 +1,44 @@
Ansible Role: munin async server
=========
This role set up Munin async server for a GNU/Linux server.
Requirements
------------
The role geerlingguy.munin needs to be deploy on the Munin server before using the current role.
Roll Variables
--------------
All variables and default values are defined in `defaults/main.yml` :
# Name of the munin-async service and munin-async package (depends on your OS, can be munin-async, munin-asyncd...)
munin_async_service_name: munin-async
munin_async_package: munin-async
# Private/Public SSH keys of Munin async server to access all Munin async client account
private_key_munin_async_user_host: ""
public_key_munin_async_user_host: ""
Dependencies
------------
None.
Example Playbook
----------------
- hosts: munin_server
roles:
- munin_async_server
License
-------
BSD
Author Information
------------------
This role was created in 2020 by Nemo.

View file

@ -0,0 +1,11 @@
---
# defaults file for munin_async_server
# Name of the munin-async service and munin-async package (depends on your OS, can be munin-async, munin-asyncd...)
munin_async_service_name: munin-async
munin_async_package: munin-async
# Private/Public SSH keys of Munin async server to access all Munin async client account
private_key_munin_async_user_host: ""
public_key_munin_async_user_host: ""

View file

@ -0,0 +1,26 @@
galaxy_info:
author: nemo
description: Set up Munin async server for GNU/Linux.
company: Wirebrass
license: license (BSD)
min_ansible_version: 2.4
platforms:
- name: Debian
versions:
- stretch
- buster
- name: Gentoo
versions:
- all
galaxy_tags:
- munin
- munin-async
- system
- server
- auto
dependencies: []

View file

@ -0,0 +1,6 @@
---
# Main tasks file for munin_async_server
- import_tasks: package.yml
- import_tasks: user.yml
- import_tasks: service.yml

View file

@ -0,0 +1,5 @@
---
- name: Munin async installed
package:
name: "{{ munin_async_package }}"
state: present

View file

@ -0,0 +1,6 @@
---
- name: Munin async enabled
service:
name: "{{ munin_async_service_name }}"
state: started
enabled: yes

View file

@ -0,0 +1,15 @@
---
- name: Deploy private key to access other Munin async node
copy:
dest: /home/munin-async/.ssh/id_rsa
owner: munin-async
group: munin-async
mode: '0600'
content: "{{ private_key_munin_async_user_host }}"
- name: Deploy public key to access other Munin async node
copy:
dest: /home/munin-async/.ssh/id_rsa.pub
owner: munin-async
group: munin-async
mode: '0644'
content: "{{ public_key_munin_async_user_host + '\n' }}"