Update Munin server role and all related resources

This commit is contained in:
Nemo 2020-07-11 00:11:21 +02:00
parent d1296fb250
commit a77c779a84
14 changed files with 96 additions and 100 deletions

View File

@ -7,9 +7,9 @@ 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_munin_user_host: |
SSH_PRIV_KEY_OF_munin_user_USER_ON_USER_HOST
vault_public_key_munin_user_host: SSH_PUB_KEY_OF_munin_user_USER_ON_USER_HOST
vault_private_key_backup_user_host: |
SSH_PRIV_KEY_OF_backup_user_USER_ON_USER_HOST

View File

@ -9,8 +9,8 @@ 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 }}"
private_key_munin_user_host: "{{ vault_private_key_munin_async_user_host }}"
public_key_munin__user_host: "{{ vault_public_key_munin_async_user_host }}"
munin_alerts: []

View File

@ -2,4 +2,6 @@
- hosts: munin_server
roles:
- geerlingguy.munin
- munin_async_server
- munin_server
- geerlingguy.certbot
- geerlingguy.nginx

View File

@ -1,44 +0,0 @@
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

@ -1,11 +0,0 @@
---
# 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

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

View File

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

View File

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

View File

@ -1,20 +0,0 @@
---
- name: Create SSH directory for munin-async user
file:
path: /var/spool/munin-async/.ssh
state: directory
mode: '0755'
- name: Deploy private key to access other Munin async node
copy:
dest: /var/spool/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: /var/spool/munin-async/.ssh/id_rsa.pub
owner: munin-async
group: munin-async
mode: '0644'
content: "{{ public_key_munin_async_user_host + '\n' }}"

View File

@ -0,0 +1,48 @@
Ansible Role: munin server
=========
This role set up Munin 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` :
# Private/Public SSH keys of Munin server to access all Munin async client account
private_key_munin_user_host: ""
public_key_munin_user_host: ""
# Munin user and group
munin_user: "munin"
munin_group: "munin"
# Munin user home directory
munin_home_directory: "/var/lib/munin"
Dependencies
------------
None.
Example Playbook
----------------
- hosts: munin_server
roles:
- munin_server
License
-------
BSD
Author Information
------------------
This role was created in 2020 by Nemo.

View File

@ -0,0 +1,13 @@
---
# defaults file for munin_async_server
# Private/Public SSH keys of Munin async server to access all Munin async client account
private_key_munin_user_host: ""
public_key_munin_user_host: ""
# Munin user and group
munin_user: "munin"
munin_group: "munin"
# Munin user home directory
munin_home_directory: "/var/lib/munin"

View File

@ -1,6 +1,6 @@
galaxy_info:
author: nemo
description: Set up Munin async server for GNU/Linux.
description: Set up Munin server for GNU/Linux.
company: Wirebrass
license: license (BSD)
@ -18,7 +18,6 @@ galaxy_info:
galaxy_tags:
- munin
- munin-async
- system
- server
- auto

View File

@ -0,0 +1,4 @@
---
# Main tasks file for munin_server
import_tasks: user.yml

View File

@ -0,0 +1,22 @@
---
- name: Create SSH directory for Munin user
file:
path: "{{ /var/lib/munin }}"/.ssh
state: directory
owner: "{{ munin_user }}"
group: "{{ munin_user }}"
mode: '0700'
- name: Deploy private key to access other Munin node
copy:
dest: "{{ /var/lib/munin }}"/.ssh/id_rsa
owner: "{{ munin_user }}"
group: "{{ munin_user }}"
mode: '0600'
content: "{{ private_key_munin_async_user_host }}"
- name: Deploy public key to access other Munin node
copy:
dest: "{{ /var/lib/munin }}"/.ssh/id_rsa.pub
owner: "{{ munin_user }}"
group: "{{ munin_user }}"
mode: '0644'
content: "{{ public_key_munin_async_user_host + '\n' }}"