diff --git a/sio2/SISR/09-ansible/dokuwiki/dokuw/hosts b/sio2/SISR/09-ansible/dokuwiki/dokuw/hosts new file mode 100644 index 0000000..ce091d1 --- /dev/null +++ b/sio2/SISR/09-ansible/dokuwiki/dokuw/hosts @@ -0,0 +1,6 @@ +[adm] +infra + +[web] +web1 +web2 diff --git a/sio2/SISR/09-ansible/dokuwiki/dokuw/local.yml b/sio2/SISR/09-ansible/dokuwiki/dokuw/local.yml new file mode 100644 index 0000000..6a95d5a --- /dev/null +++ b/sio2/SISR/09-ansible/dokuwiki/dokuw/local.yml @@ -0,0 +1,5 @@ +--- +- hosts : web + roles: + - web + - doku diff --git a/sio2/SISR/09-ansible/dokuwiki/dokuw/roles/doku/tasks/main.yml b/sio2/SISR/09-ansible/dokuwiki/dokuw/roles/doku/tasks/main.yml new file mode 100644 index 0000000..3ded03a --- /dev/null +++ b/sio2/SISR/09-ansible/dokuwiki/dokuw/roles/doku/tasks/main.yml @@ -0,0 +1,53 @@ +--- +- name: recuperer dokuwiki-stables.tgz depuis le machine depl + get_url: + url: http://depl/store/dokuwiki-stable.tgz + dest: /tmp + +- name: extraction archive + unarchive: + src: /tmp/dokuwiki-stable.tgz + dest: /var/www/html/ + remote_src: yes + +- name: renommer repertoire + stat: + path: /var/www/html/dokuwiki-2024-02-06b + register: doku + +#- name: renommer doku en nouveau si existe + # command: mv /var/www/html/dokuwiki-2024-02-06b /var/www/html/doku + #when: doku.stat.exists + +- name: donner les droits root au repertoire /var/www/html/doku + file: + path: /var/www/html/doku + state: directory + recurse: yes + owner: www-data + group: www-data + +- name: donner les droits a www-data pour le repertoire /var/www/html/doku/data + file: + path: /var/www/html/doku/data + state: directory + recurse: yes + owner: www-data + group: www-data + +- name: donner les droits a www-data pour le repertoire /var/www/html/doku/lib + file: + path: /var/www/html/doku/lib + state: directory + recurse: yes + owner: www-data + group: www-data + +- name: donner les droits a www-data pour le repertoire /var/www/html/doku/conf + file: + path: /var/www/html/doku/conf + state: directory + recurse: yes + owner: www-data + group: www-data + diff --git a/sio2/SISR/09-ansible/dokuwiki/dokuw/roles/web/tasks/main.yml b/sio2/SISR/09-ansible/dokuwiki/dokuw/roles/web/tasks/main.yml new file mode 100644 index 0000000..d0d150a --- /dev/null +++ b/sio2/SISR/09-ansible/dokuwiki/dokuw/roles/web/tasks/main.yml @@ -0,0 +1,11 @@ +--- +- name: installation des paquets apache, php ...2 + apt: + name: + - apache2 + - php + - php-mbstring + - php-gd + - php-xml + state: present +