ajout tp doku

This commit is contained in:
root 2023-10-20 11:01:22 +02:00
parent 365ac0717a
commit e88bb6e440
11 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,9 @@
[adm]
infra
[web]
web1
web2
[doc]
doku

View File

@ -0,0 +1,6 @@
- hosts: doku
roles:
- web
- doku

View File

@ -0,0 +1,18 @@
vars:
- chemin_fichier: /var/www/html/doku
- name: recuperation dokuwiki-stable.tgz depuis machine depl
get_url:
url: http://depl/store/dokuwiki-stable.tgz
dest: /tmp/
- name: Extraction archive
ansible.builtin.unarchive:
src: /tmp/dokuwiki-stable.tgz
dest: /var/www/html/
- name: changer propriétaire du fichier var/www/html/doku
file:
path: "{{ chemin_fichier }}"
owner: www-data:www-data data lib conf
become: true

View File

@ -0,0 +1,37 @@
- name: 1. recuperation dokuwiki-stable.tgz depuis machine depl
get_url:
url: http://depl/store/dokuwiki-stable.tgz
dest: /tmp
- name: 2. Extraction archive dokuwiki-stage.tgz
unarchive:
src: /tmp/dokuwiki-stable.tgz
dest: /var/www/html/
remote_src: yes
- name: 3. stat dokuwiki
stat:
path: /var/www/html/dokuwiki-2023-04-04
register: doku_stat
- name: 4. On renomme doku-v... en doku
command: mv /var/www/html/dokuwiki-2023-04-04 /var/www/html/doku
when: doku_stat.stat.exists
- name: 5. Changer propritaire group et permissions
file:
path: /var/www/html/doku
owner: root
group: root
mode: '0755'
recurse: yes
- name: 6. Changer propritaire. group et permissions
file:
path: /var/www/html/doku
owner: www-data
group: www-data
recurse: yes
# mode: '755'

View File

@ -0,0 +1,13 @@
- name: 1. installe apache2 php et ces dependances
apt:
name:
- apache2
- php
# - php-gd
- php-mbstring
state: present
- name: 2. lance Apache
service:
name: apache2
state: started