nouveau fichier : sio2/SISR/09-ansible/hosts
nouveau fichier : sio2/SISR/09-ansible/index.html nouveau fichier : sio2/SISR/09-ansible/squid.conf.j2 nouveau fichier : sio2/SISR/09-ansible/squid.yml nouveau fichier : sio2/SISR/09-ansible/syslog-cli.yml nouveau fichier : sio2/SISR/09-ansible/syslog.yml nouveau fichier : sio2/SISR/09-ansible/web.yml
This commit is contained in:
parent
e20efad442
commit
e09e6c1fc1
6
sio2/SISR/09-ansible/hosts
Normal file
6
sio2/SISR/09-ansible/hosts
Normal file
@ -0,0 +1,6 @@
|
||||
[adm]
|
||||
infra
|
||||
|
||||
[web]
|
||||
web1
|
||||
web2
|
1
sio2/SISR/09-ansible/index.html
Normal file
1
sio2/SISR/09-ansible/index.html
Normal file
@ -0,0 +1 @@
|
||||
bonjour
|
9161
sio2/SISR/09-ansible/squid.conf.j2
Normal file
9161
sio2/SISR/09-ansible/squid.conf.j2
Normal file
File diff suppressed because it is too large
Load Diff
29
sio2/SISR/09-ansible/squid.yml
Normal file
29
sio2/SISR/09-ansible/squid.yml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
- hosts: infra
|
||||
vars:
|
||||
proxy_port: 8080
|
||||
proxy_mem: 128
|
||||
proxy_localnet: "192.168.0.0/24"
|
||||
|
||||
tasks:
|
||||
- name: installation de squid
|
||||
apt:
|
||||
name: squid
|
||||
state: present
|
||||
|
||||
# - name: recup squid.conf
|
||||
# fetch:
|
||||
# src: /etc/squid/squid.conf
|
||||
# dest: squid.conf.j2
|
||||
# flat: yes
|
||||
- name: constituer squid.conf.j2 a partir de squid.conf
|
||||
template:
|
||||
src: squid.conf.j2
|
||||
dest: /etc/squid/squid.conf
|
||||
notify: restart squid
|
||||
|
||||
handlers:
|
||||
- name: restart squid
|
||||
service:
|
||||
name: squid
|
||||
state: restarted
|
32
sio2/SISR/09-ansible/syslog-cli.yml
Normal file
32
sio2/SISR/09-ansible/syslog-cli.yml
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
- hosts: web
|
||||
tasks:
|
||||
- name: installation de rsyslog
|
||||
apt:
|
||||
name: rsyslog
|
||||
state: present
|
||||
|
||||
- name: decommenter la ligne ForwardToSyslog=yes
|
||||
replace:
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: '^#ForwardToSyslog=yes'
|
||||
replace: 'ForwardToSyslog=yes'
|
||||
notify: restart journald
|
||||
|
||||
- name: serveur distant est present
|
||||
lineinfile:
|
||||
path: /etc/rsyslog.conf
|
||||
line: '*.*@192.168.0.21:514'
|
||||
create: yes
|
||||
notify: restart rsyslog
|
||||
|
||||
handlers:
|
||||
- name: restart journald
|
||||
service:
|
||||
name: systemd.journald
|
||||
state: restarted
|
||||
|
||||
- name: restart rsyslog
|
||||
service:
|
||||
name: rsyslog
|
||||
state: restarted
|
28
sio2/SISR/09-ansible/syslog.yml
Normal file
28
sio2/SISR/09-ansible/syslog.yml
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
- hosts: adm
|
||||
tasks:
|
||||
- name: installation de rsyslog
|
||||
apt:
|
||||
name: rsyslog
|
||||
state: present
|
||||
|
||||
- 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: decommenter toutes les lignes avec le port 514 udp
|
||||
replace:
|
||||
path: /etc/rsyslog.conf
|
||||
regexp: '^#input\(type="imudp" port="514"\)'
|
||||
replace: 'input(type="imudp" port="514")'
|
||||
notify: restart rsyslog
|
||||
|
||||
handlers:
|
||||
- name: restart rsyslog
|
||||
service:
|
||||
name: rsyslog.service
|
||||
state: restarted
|
||||
|
22
sio2/SISR/09-ansible/web.yml
Normal file
22
sio2/SISR/09-ansible/web.yml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
- hosts: web
|
||||
tasks:
|
||||
- name: installation de apache2
|
||||
apt:
|
||||
name: apache2
|
||||
state: present
|
||||
|
||||
- name: installation de php
|
||||
apt:
|
||||
name: php
|
||||
state: present
|
||||
|
||||
- name: installation de php-mbstring
|
||||
apt:
|
||||
name: php-mbstring
|
||||
state: present
|
||||
|
||||
- name: inserer un fichier index.html dans /var/www/html
|
||||
template:
|
||||
src: index.html
|
||||
dest: /var/www/html/
|
Loading…
x
Reference in New Issue
Block a user