diff --git a/sio2/SISR/Ansible/dokuw/hosts b/sio2/SISR/Ansible/dokuw/hosts new file mode 100644 index 0000000..dd63063 --- /dev/null +++ b/sio2/SISR/Ansible/dokuw/hosts @@ -0,0 +1,9 @@ +[adm] +infra + +[web] +web1 +web2 + +[doc] +doku diff --git a/sio2/SISR/Ansible/dokuw/local.yml b/sio2/SISR/Ansible/dokuw/local.yml new file mode 100644 index 0000000..519130d --- /dev/null +++ b/sio2/SISR/Ansible/dokuw/local.yml @@ -0,0 +1,6 @@ + +- hosts: doku + roles: + - web + - doku + diff --git a/sio2/SISR/Ansible/dokuw/roles/doku/main.yml b/sio2/SISR/Ansible/dokuw/roles/doku/main.yml new file mode 100644 index 0000000..38aa1e8 --- /dev/null +++ b/sio2/SISR/Ansible/dokuw/roles/doku/main.yml @@ -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 diff --git a/sio2/SISR/Ansible/dokuw/roles/doku/tasks/main.yml b/sio2/SISR/Ansible/dokuw/roles/doku/tasks/main.yml new file mode 100644 index 0000000..6d10749 --- /dev/null +++ b/sio2/SISR/Ansible/dokuw/roles/doku/tasks/main.yml @@ -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' + + diff --git a/sio2/SISR/Ansible/dokuw/roles/web/tasks/main.yml b/sio2/SISR/Ansible/dokuw/roles/web/tasks/main.yml new file mode 100644 index 0000000..2aed415 --- /dev/null +++ b/sio2/SISR/Ansible/dokuw/roles/web/tasks/main.yml @@ -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 diff --git a/sio2/CYBER/Ansible/hosts b/sio2/SISR/Ansible/hosts similarity index 100% rename from sio2/CYBER/Ansible/hosts rename to sio2/SISR/Ansible/hosts diff --git a/sio2/CYBER/Ansible/squid-j2.yml b/sio2/SISR/Ansible/squid-j2.yml similarity index 100% rename from sio2/CYBER/Ansible/squid-j2.yml rename to sio2/SISR/Ansible/squid-j2.yml diff --git a/sio2/CYBER/Ansible/squid.yml b/sio2/SISR/Ansible/squid.yml similarity index 100% rename from sio2/CYBER/Ansible/squid.yml rename to sio2/SISR/Ansible/squid.yml diff --git a/sio2/CYBER/Ansible/syslog-cli.yml b/sio2/SISR/Ansible/syslog-cli.yml similarity index 100% rename from sio2/CYBER/Ansible/syslog-cli.yml rename to sio2/SISR/Ansible/syslog-cli.yml diff --git a/sio2/CYBER/Ansible/syslog.yml b/sio2/SISR/Ansible/syslog.yml similarity index 100% rename from sio2/CYBER/Ansible/syslog.yml rename to sio2/SISR/Ansible/syslog.yml diff --git a/sio2/CYBER/Ansible/web.yml b/sio2/SISR/Ansible/web.yml similarity index 100% rename from sio2/CYBER/Ansible/web.yml rename to sio2/SISR/Ansible/web.yml