modifications des playbooks journald snd et rcv

This commit is contained in:
root 2023-12-25 14:57:04 +01:00
parent d9fb25425d
commit 01faab4a6e
2 changed files with 17 additions and 10 deletions

View File

@ -1,16 +1,16 @@
--- ---
- name: Installation de systemd-journal-remote - name: 1. Installation de systemd-journal-remote
apt: apt:
name: systemd-journal-remote name: systemd-journal-remote
state: present state: present
- name: Enable et start systemd-journal-remote.socket - name: 2. Enable et start systemd-journal-remote.socket
systemd: systemd:
name: systemd-journal-remote.socket name: systemd-journal-remote.socket
enabled: yes enabled: yes
state: started state: started
- name: Copie de systemd-journal-remote.service dans /etc/systemd/system - name: 3. Copie de systemd-journal-remote.service dans /etc/systemd/system
copy: copy:
src: /lib/systemd/system/systemd-journal-remote.service src: /lib/systemd/system/systemd-journal-remote.service
dest: /etc/systemd/system/systemd-journal-remote.service dest: /etc/systemd/system/systemd-journal-remote.service
@ -18,20 +18,27 @@
backup: yes backup: yes
- name: Modification de systemd-journal-remote.service - name: 4. Modification de systemd-journal-remote.service
replace: replace:
path: /etc/systemd/system/systemd-journal-remote.service path: /etc/systemd/system/systemd-journal-remote.service
regexp: '--listen-https=-3' regexp: '--listen-https=-3'
replace: '--listen-http=-3' replace: '--listen-http=-3'
- name: Creation /var/log/journal/remote directory - name: 5. active le mode SplitMode en mode Host
replace:
path: /etc/systemd/journal-remote.conf
regexp: '^#\sSplitMode=host'
replace: 'SplitMode=host'
- name: 6. Creation /var/log/journal/remote directory
file: file:
path: /var/log/journal/remote path: /var/log/journal/remote
state: directory state: directory
owner: systemd-journal-remote owner: systemd-journal-remote
- name: Redemarrage de systemd - name: 7. Redemarrage de systemd
systemd: systemd:
daemon_reload: yes daemon_reload: yes
notify: # notify:
- restart jourald #- restart journald

View File

@ -8,7 +8,7 @@
- name: 2. indique l'URL journald distant - name: 2. indique l'URL journald distant
replace: replace:
path: /etc/systemd/journal-upload.conf path: /etc/systemd/journal-upload.conf
regexp: '^#URL=' regexp: '^#\sURL='
replace: 'URL=http://syslog.gsb.adm:19532' replace: 'URL=http://syslog.gsb.adm:19532'
- name: 3. Just force systemd to reread configs (2.4 and above) - name: 3. Just force systemd to reread configs (2.4 and above)
@ -23,7 +23,7 @@
- name: 5. redemarre systemd-journal-upload.service - name: 5. redemarre systemd-journal-upload.service
service: service:
name: systemd-journal-upload.service name: systemd-journal-upload.service
state: restart state: restarted
#notify: #notify:
#- enable systemd-journal-upload #- enable systemd-journal-upload
#- restart systemd-journal-upload #- restart systemd-journal-upload