Ajout role journald-rcv
This commit is contained in:
parent
8cfbefc4dc
commit
a7315fa4c8
83
localhost,
Normal file
83
localhost,
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Ce fichier viminfo a été généré par Vim 9.0.
|
||||||
|
# Vous pouvez l'éditer, mais soyez prudent.
|
||||||
|
|
||||||
|
# Viminfo version
|
||||||
|
|1,4
|
||||||
|
|
||||||
|
# 'encoding' dans lequel ce fichier a été écrit
|
||||||
|
*encoding=utf-8
|
||||||
|
|
||||||
|
|
||||||
|
# hlsearch on (H) or off (h):
|
||||||
|
~h
|
||||||
|
# Historique ligne de commande (chronologie décroissante) :
|
||||||
|
:q!
|
||||||
|
|2,0,1703236388,,"q!"
|
||||||
|
:x
|
||||||
|
|2,0,1703236381,,"x"
|
||||||
|
:x!
|
||||||
|
|2,0,1703236221,,"x!"
|
||||||
|
|
||||||
|
# Historique chaîne de recherche (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Historique expression (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Historique ligne de saisie (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Historique Ligne de débogage (chronologie décroissante) :
|
||||||
|
|
||||||
|
# Registres :
|
||||||
|
""1 LINE 0
|
||||||
|
connection: local
|
||||||
|
|3,1,1,1,1,0,1703236374," connection: local"
|
||||||
|
"2 LINE 0
|
||||||
|
hosts: localhost
|
||||||
|
|3,0,2,1,1,0,1703236374," hosts: localhost"
|
||||||
|
|
||||||
|
# Marques dans le fichier :
|
||||||
|
'0 1 2 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,48,1,2,1703236388,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'1 1 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,49,1,9,1703236339,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'2 9 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,50,9,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'3 9 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,51,9,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'4 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,52,11,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'5 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,53,11,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'6 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,54,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'7 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,55,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'8 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,56,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
'9 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,57,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
|
||||||
|
# Liste de sauts (le plus récent en premier) :
|
||||||
|
-' 1 2 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,2,1703236388,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 1 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,9,1703236339,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 9 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,9,9,1703236318,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,11,9,1703236318,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 11 9 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,11,9,1703236221,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,13,1703236018,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
-' 1 13 ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
|4,39,1,13,1703236013,"~/tools/ansible/gsb2024/s-mon.yml"
|
||||||
|
|
||||||
|
# Historique des marques dans les fichiers (les plus récentes en premier) :
|
||||||
|
|
||||||
|
> ~/tools/ansible/gsb2024/s-mon.yml
|
||||||
|
* 1703236386 0
|
||||||
|
" 1 2
|
||||||
|
^ 9 10
|
||||||
|
. 2 0
|
||||||
|
+ 10 0
|
||||||
|
+ 2 0
|
16
roles/journald-rcv/README.md
Normal file
16
roles/journald-rcv/README.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Role syslog : installation et configuration de syslog serveur (centralisation des logs)
|
||||||
|
***
|
||||||
|
|
||||||
|
Ce role a pour objectif de activer le module UDP dans le fichier /etc/rsyslog.conf pour accepter les logs entrants des machines concernées :
|
||||||
|
on décommente la ligne suivante :
|
||||||
|
'module(load="imudp"\)'
|
||||||
|
|
||||||
|
Ensuite le role active l'écoute du module UDP sur le port 514 afin de pouvoir envoyer les logs.
|
||||||
|
on décommente la ligne suivante dans le même fichier que ci-dessus :
|
||||||
|
'input\(type="imudp" port="514"\)'
|
||||||
|
|
||||||
|
pour finir le role va charger le module UDP afin que la machine **s-infra** puissent reçevoir les logs entrants.
|
||||||
|
Pour faire cela on décommente la ligne suivante dans le fichier /etc/systemd/journald.conf :
|
||||||
|
'ForwardToSyslog=yes'
|
||||||
|
|
||||||
|
pour finir le role va redemmarer automatiquement les services journald et rsyslog
|
5
roles/journald-rcv/handlers/main.yml
Normal file
5
roles/journald-rcv/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: restart journald
|
||||||
|
service:
|
||||||
|
name: systemd-journald.service
|
||||||
|
state: restarted
|
37
roles/journald-rcv/tasks/main.yml
Normal file
37
roles/journald-rcv/tasks/main.yml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
- name: Installation de systemd-journal-remote
|
||||||
|
apt:
|
||||||
|
name: systemd-journal-remote
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Enable et start systemd-journal-remote.socket
|
||||||
|
systemd:
|
||||||
|
name: systemd-journal-remote.socket
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: Copie de systemd-journal-remote.service dans /etc/systemd/system
|
||||||
|
copy:
|
||||||
|
src: /lib/systemd/system/systemd-journal-remote.service
|
||||||
|
dest: /etc/systemd/system/systemd-journal-remote.service
|
||||||
|
remote_src: yes
|
||||||
|
backup: yes
|
||||||
|
|
||||||
|
|
||||||
|
- name: Modification de systemd-journal-remote.service
|
||||||
|
replace:
|
||||||
|
path: /etc/systemd/system/systemd-journal-remote.service
|
||||||
|
regexp: '--listen-https=-3'
|
||||||
|
replace: '--listen-http=-3'
|
||||||
|
|
||||||
|
- name: Creation /var/log/journal/remote directory
|
||||||
|
file:
|
||||||
|
path: /var/log/journal/remote
|
||||||
|
state: directory
|
||||||
|
owner: systemd-journal-remote
|
||||||
|
|
||||||
|
- name: Redemarrage de systemd
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
notify:
|
||||||
|
- restart systemd
|
18
s-mon.yml
18
s-mon.yml
@ -1,16 +1,14 @@
|
|||||||
|
---
|
||||||
- name: Nagios
|
- name: Nagios
|
||||||
hosts: localhost
|
hosts: all
|
||||||
connection: local
|
# become: yes
|
||||||
become: yes
|
# become_method: sudo
|
||||||
become_method: sudo
|
# become_user: root
|
||||||
become_user: root
|
# vars:
|
||||||
vars:
|
# access: "Restricted Nagios4 Access"
|
||||||
access: "Restricted Nagios4 Access"
|
|
||||||
roles:
|
roles:
|
||||||
- base
|
- base
|
||||||
- goss
|
- goss
|
||||||
- nagios
|
|
||||||
- postfix
|
|
||||||
- ssh-cli
|
- ssh-cli
|
||||||
- syslog
|
- journald-rcv
|
||||||
- post
|
- post
|
||||||
|
Loading…
x
Reference in New Issue
Block a user