45-ansible/
This commit is contained in:
parent
5691bc4e42
commit
61df4cf638
6
sio2/sisr/45-ansible/testansible/hosts
Normal file
6
sio2/sisr/45-ansible/testansible/hosts
Normal file
@ -0,0 +1,6 @@
|
||||
[adm]
|
||||
infra
|
||||
|
||||
[web]
|
||||
web1
|
||||
web2
|
6
sio2/sisr/45-ansible/tpansible/hosts
Normal file
6
sio2/sisr/45-ansible/tpansible/hosts
Normal file
@ -0,0 +1,6 @@
|
||||
[adm]
|
||||
infra
|
||||
|
||||
[web]
|
||||
web1
|
||||
web2
|
1
sio2/sisr/45-ansible/tpansible/index.html
Normal file
1
sio2/sisr/45-ansible/tpansible/index.html
Normal file
@ -0,0 +1 @@
|
||||
Salut
|
29
sio2/sisr/45-ansible/tpansible/syslog-cli.yml
Normal file
29
sio2/sisr/45-ansible/tpansible/syslog-cli.yml
Normal file
@ -0,0 +1,29 @@
|
||||
- hosts: web
|
||||
tasks:
|
||||
|
||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
||||
replace:
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: '^#ForwardToSyslog=yes'
|
||||
replace: 'ForwardToSyslog=yes'
|
||||
notify:
|
||||
- restart journald
|
||||
|
||||
- name: Ajoute l'indication de serveur syslog distant si elle n'est pas presente
|
||||
lineinfile:
|
||||
path: /etc/rsyslog.conf
|
||||
line: '*.* @192.168.0.23:514'
|
||||
create: yes
|
||||
notify:
|
||||
- restart rsyslog
|
||||
|
||||
handlers:
|
||||
- name: restart journald
|
||||
service:
|
||||
name: systemd-journald.service
|
||||
state: restarted
|
||||
|
||||
- name: restart syslog
|
||||
service:
|
||||
name: rsyslog
|
||||
state: restarted
|
37
sio2/sisr/45-ansible/tpansible/syslog.yml
Normal file
37
sio2/sisr/45-ansible/tpansible/syslog.yml
Normal file
@ -0,0 +1,37 @@
|
||||
- hosts: adm
|
||||
tasks:
|
||||
|
||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
||||
replace:
|
||||
path: /etc/rsyslog.conf
|
||||
regexp: '^#module\(load="imudp"\)'
|
||||
replace: 'module(load="imudp")'
|
||||
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")'
|
||||
notify:
|
||||
- restart rsyslog
|
||||
|
||||
- name: decommente le chargement du module imudp dans rsyslog.conf
|
||||
replace:
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: '^#ForwardToSyslog=yes'
|
||||
replace: 'ForwardToSyslog=yes'
|
||||
notify:
|
||||
- restart journald
|
||||
|
||||
handlers:
|
||||
- name: restart rsyslog
|
||||
service:
|
||||
name: rsyslog
|
||||
state: restarted
|
||||
|
||||
- name: restart journald
|
||||
service:
|
||||
name: systemd-journald.service
|
||||
state: restarted
|
18
sio2/sisr/45-ansible/tpansible/web.yml
Normal file
18
sio2/sisr/45-ansible/tpansible/web.yml
Normal file
@ -0,0 +1,18 @@
|
||||
- hosts: web
|
||||
tasks:
|
||||
- name: Installation apache2
|
||||
apt:
|
||||
name: apache2
|
||||
state: present
|
||||
- name: Installation php
|
||||
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