ajout répertoit 40-Ansible et fichier
This commit is contained in:
parent
76ae24a4f1
commit
87899ee6a9
6
sio2/sisr2/40-Ansible/hosts
Normal file
6
sio2/sisr2/40-Ansible/hosts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[adm]
|
||||||
|
infra
|
||||||
|
|
||||||
|
[web]
|
||||||
|
web1
|
||||||
|
web2
|
1
sio2/sisr2/40-Ansible/index.html
Normal file
1
sio2/sisr2/40-Ansible/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
Coucou
|
22
sio2/sisr2/40-Ansible/syslog-cli.yml
Normal file
22
sio2/sisr2/40-Ansible/syslog-cli.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
- hosts: web
|
||||||
|
tasks:
|
||||||
|
- name: decommente l'option ForwardToSyslog
|
||||||
|
replace:
|
||||||
|
path: /etc/systemd/journald.conf
|
||||||
|
regexp: '^#ForwardToSyslog=yes'
|
||||||
|
replace: 'ForwardToSyslog=yes'
|
||||||
|
backup: true
|
||||||
|
notify: Restart systemd-journald.service
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Restart systemd-journald.service
|
||||||
|
service:
|
||||||
|
name: systemd-journald.service
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: Ajoute l'indication de serveur syslog distant si elle n'est pas presente
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/rsyslog.conf
|
||||||
|
line: '*.* @192.168.0.42:514'
|
||||||
|
create: yes
|
25
sio2/sisr2/40-Ansible/syslog.yml
Normal file
25
sio2/sisr2/40-Ansible/syslog.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- hosts: infra
|
||||||
|
tasks:
|
||||||
|
- name: decommente le chargement du module imudp dans rsyslog.conf
|
||||||
|
replace:
|
||||||
|
path: /etc/rsyslog.conf
|
||||||
|
regexp: '^#module\(load="imudp"\)'
|
||||||
|
replace: 'module(load="imudp")'
|
||||||
|
backup: true
|
||||||
|
notify: Restart Rsyslog
|
||||||
|
|
||||||
|
- name: decommente le chargement du module imudp dans rsyslog.conf
|
||||||
|
replace:
|
||||||
|
path: /etc/rsyslog.conf
|
||||||
|
regexp: '^#input\(type="imudp" port="514"\)'
|
||||||
|
replace: 'input(type="imudp" port="514")'
|
||||||
|
backup: true
|
||||||
|
notify: Restart Rsyslog
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Restart Rsyslog
|
||||||
|
service:
|
||||||
|
name: rsyslog
|
||||||
|
state: restarted
|
||||||
|
|
24
sio2/sisr2/40-Ansible/web.yml
Normal file
24
sio2/sisr2/40-Ansible/web.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
- name: mon playbook
|
||||||
|
hosts: web
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: installation apache2
|
||||||
|
apt :
|
||||||
|
name: apache2
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: installation php-mbstring
|
||||||
|
apt :
|
||||||
|
name: php
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: installation php-mbstring
|
||||||
|
apt :
|
||||||
|
name: php-mbstring
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Copie index.html
|
||||||
|
copy:
|
||||||
|
src: index.html
|
||||||
|
dest: /var/www/html/
|
Loading…
x
Reference in New Issue
Block a user