ajout yml
This commit is contained in:
0
testansible/.web.yml.swp
Normal file
0
testansible/.web.yml.swp
Normal file
5
testansible/dokuw/local.yml
Normal file
5
testansible/dokuw/local.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: all
|
||||
roles:
|
||||
- web
|
||||
- doku
|
||||
10
testansible/dokuw/roles/web/tasks/main.yml
Normal file
10
testansible/dokuw/roles/web/tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: installation apache2
|
||||
apt:
|
||||
name: apache2
|
||||
state: present
|
||||
|
||||
- name: installation php
|
||||
apt:
|
||||
name: php
|
||||
state: present
|
||||
|
||||
6
testansible/hosts
Normal file
6
testansible/hosts
Normal file
@@ -0,0 +1,6 @@
|
||||
[adm]
|
||||
infra
|
||||
|
||||
[web]
|
||||
web1
|
||||
web2
|
||||
1
testansible/index.html
Normal file
1
testansible/index.html
Normal file
@@ -0,0 +1 @@
|
||||
On m'appelle l'ovni
|
||||
8567
testansible/squid.conf.j2
Normal file
8567
testansible/squid.conf.j2
Normal file
File diff suppressed because it is too large
Load Diff
16
testansible/squid.yml
Normal file
16
testansible/squid.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
- hosts:
|
||||
|
||||
tasks:
|
||||
- name: install squid
|
||||
apt :
|
||||
name: squid
|
||||
state: present
|
||||
|
||||
- name: mise en place du fichier de conf
|
||||
template:
|
||||
src: squid.conf.j2
|
||||
dest: /etc/squid/squid.conf
|
||||
notify:
|
||||
- restart squid
|
||||
|
||||
25
testansible/syslog-cli.yml
Normal file
25
testansible/syslog-cli.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
- hosts: web
|
||||
tasks:
|
||||
- name: on decommente l'option ForwardToSyslog=yes dans /etc/systemd/journald>
|
||||
replace:
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: '^#ForwardToSyslog=yes'
|
||||
replace: 'ForwardToSyslog=yes'
|
||||
notify:
|
||||
- restart journald
|
||||
- name: Ajoute l'indication de serveur syslog distant
|
||||
lineinfile:
|
||||
path: /etc/rsyslog.conf
|
||||
line: '*.* @192.168.0.37:514'
|
||||
create: yes
|
||||
notify:
|
||||
- restart rsyslog
|
||||
handlers:
|
||||
- name: restart journald
|
||||
service:
|
||||
name: systemd-journald.service
|
||||
state: restarted
|
||||
- name: restart rsyslog
|
||||
service:
|
||||
name: rsyslog
|
||||
state: restarted
|
||||
22
testansible/syslog.yml
Normal file
22
testansible/syslog.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
- hosts: adm
|
||||
tasks:
|
||||
- name: on active le module imudp dans /etc/rsyslog.conf
|
||||
replace:
|
||||
path: /etc/rsyslog.conf
|
||||
regexp: '^#module\(load="imudp"\)'
|
||||
replace: 'module(load="imudp")'
|
||||
notify:
|
||||
- restart rsyslog
|
||||
- name: on decommente la ligne input type imudp port 514 dans /etc/rsyslog.conf
|
||||
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
|
||||
state: restarted
|
||||
|
||||
27
testansible/web.yml
Normal file
27
testansible/web.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- hosts: web
|
||||
vars:
|
||||
http_port: 80
|
||||
max_clients: 200
|
||||
remote_user: root
|
||||
tasks:
|
||||
- name: install apache2
|
||||
apt :
|
||||
name: apache2
|
||||
state: present
|
||||
- name: install php
|
||||
apt :
|
||||
name: php
|
||||
state: present
|
||||
- name: install php-mbstring
|
||||
apt :
|
||||
name: php-mbstring
|
||||
state: present
|
||||
- name: apache is running
|
||||
service:
|
||||
name: apache2
|
||||
state: started
|
||||
- name: copie fichier index.html
|
||||
copy:
|
||||
src: index.html
|
||||
dest: /var/www/html/
|
||||
Reference in New Issue
Block a user