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:
root 2024-10-11 11:29:28 +02:00
parent e20efad442
commit e09e6c1fc1
7 changed files with 9279 additions and 0 deletions

View File

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

View File

@ -0,0 +1 @@
bonjour

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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

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