Ajout du tp ansible
This commit is contained in:
4
sisr2/sisr/30-ansible/doku/local.yml
Normal file
4
sisr2/sisr/30-ansible/doku/local.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- web
|
||||
- doku
|
||||
30
sisr2/sisr/30-ansible/doku/main-doku.yml
Normal file
30
sisr2/sisr/30-ansible/doku/main-doku.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
- name: recuperation dokuwiki-stable.tgz depuis machine depl
|
||||
get_url:
|
||||
url: http://depl/store/dokuwiki-stable.tgz
|
||||
dest: /tmp
|
||||
|
||||
- name: nettoyage repertoire doku
|
||||
ansible.builtin.file:
|
||||
path: /var/www/html/dokuwiki
|
||||
state: directory
|
||||
recurse: yes
|
||||
force: true
|
||||
|
||||
- name: Extraction archive
|
||||
ansible.builtin.unarchive:
|
||||
src: /tmp/dokuwiki-stable.tgz
|
||||
dest: /var/www/html
|
||||
remote_src: yes
|
||||
|
||||
- name: Renommage fichier dokuwiki
|
||||
ansible.builtin.command: mv /var/www/html/dokuwiki-2024-02-06b /var/www/html/dokuwiki
|
||||
|
||||
- name: Attribution des droits à www-data
|
||||
file:
|
||||
path: /var/www/html/dokuwiki
|
||||
owner: www-data
|
||||
group: www-data
|
||||
recurse: yes
|
||||
|
||||
|
||||
|
||||
10
sisr2/sisr/30-ansible/doku/main-web.yml
Normal file
10
sisr2/sisr/30-ansible/doku/main-web.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: installation apache2 et php
|
||||
apt:
|
||||
name:
|
||||
- apache2
|
||||
- php
|
||||
- php-gd
|
||||
- php-mbstring
|
||||
- php-ldap
|
||||
- php-xml
|
||||
state: present
|
||||
6
sisr2/sisr/30-ansible/hosts
Normal file
6
sisr2/sisr/30-ansible/hosts
Normal file
@@ -0,0 +1,6 @@
|
||||
[adm]
|
||||
infra
|
||||
|
||||
[web]
|
||||
web1
|
||||
web2
|
||||
9155
sisr2/sisr/30-ansible/squid/squid.conf
Normal file
9155
sisr2/sisr/30-ansible/squid/squid.conf
Normal file
File diff suppressed because it is too large
Load Diff
9157
sisr2/sisr/30-ansible/squid/squid.conf.j2
Normal file
9157
sisr2/sisr/30-ansible/squid/squid.conf.j2
Normal file
File diff suppressed because it is too large
Load Diff
26
sisr2/sisr/30-ansible/squid/squid.yml
Normal file
26
sisr2/sisr/30-ansible/squid/squid.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: squid.yml
|
||||
hosts: infra
|
||||
vars:
|
||||
- proxy_port: 8080
|
||||
- proxy_mem: 128
|
||||
- proxy_localnet: 192.168.0.0/24
|
||||
|
||||
|
||||
tasks:
|
||||
- name: Install squid
|
||||
apt:
|
||||
name: squid
|
||||
state: present
|
||||
|
||||
- name: Deploy squid.conf.j2
|
||||
template:
|
||||
src: ./squid.conf.j2
|
||||
dest: /etc/squid/squid.conf
|
||||
notify:
|
||||
restart-squid
|
||||
handlers:
|
||||
- name: restart-squid
|
||||
service:
|
||||
name: squid
|
||||
state: restarted
|
||||
0
sisr2/sisr/30-ansible/syslog/syslog-cli.yml
Normal file
0
sisr2/sisr/30-ansible/syslog/syslog-cli.yml
Normal file
12
sisr2/sisr/30-ansible/syslog/syslog.yml
Normal file
12
sisr2/sisr/30-ansible/syslog/syslog.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Installation rsyslog
|
||||
apt:
|
||||
name:
|
||||
- rsyslog
|
||||
update_cache: yes
|
||||
state: latest
|
||||
|
||||
|
||||
18
sisr2/sisr/30-ansible/web/web.yml
Normal file
18
sisr2/sisr/30-ansible/web/web.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: install apache2
|
||||
apt:
|
||||
name:
|
||||
- apache2
|
||||
- php
|
||||
- php-mbstring
|
||||
update_cache: yes
|
||||
state: latest
|
||||
- name: insertion index.html dans /var/www/html
|
||||
ansible.builtin.copy:
|
||||
src: index.html
|
||||
dest: /var/www/html/
|
||||
mode: 0664
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user