ajout répertoit 40-Ansible et fichier

This commit is contained in:
mathis 2022-10-11 09:12:29 +02:00
parent 76ae24a4f1
commit 87899ee6a9
5 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[adm]
infra
[web]
web1
web2

View File

@ -0,0 +1 @@
Coucou

View 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

View 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

View 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/