From 5d2b6c666092842af6ba162f28f1c7ef5f087dd7 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 7 Feb 2022 15:48:20 +0100 Subject: [PATCH] premier commit ap4 --- ansible/local.yml | 9 +++++ ansible/roles/adminer/tasks/main.yml | 20 ++++++++++ ansible/roles/doku/tasks/main.yml | 58 ++++++++++++++++++++++++++++ ansible/roles/paquet/tasks/main.yml | 29 ++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 ansible/local.yml create mode 100644 ansible/roles/adminer/tasks/main.yml create mode 100644 ansible/roles/doku/tasks/main.yml create mode 100644 ansible/roles/paquet/tasks/main.yml diff --git a/ansible/local.yml b/ansible/local.yml new file mode 100644 index 0000000..8e7718b --- /dev/null +++ b/ansible/local.yml @@ -0,0 +1,9 @@ +- hosts: localhost + connection: local + become: yes + become_method: sudo + become_user: root + roles: + - paquet + - doku + - adminer diff --git a/ansible/roles/adminer/tasks/main.yml b/ansible/roles/adminer/tasks/main.yml new file mode 100644 index 0000000..ba08f22 --- /dev/null +++ b/ansible/roles/adminer/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: récupération de adminer.php + get_url: + url: http://www.adminer.org/latest.php + dest: /var/www/html/adminer.php + +- name: droit adminer data + file: + path: /var/www/html/adminer + state: directory + owner: www-data + group: www-data + recurse: yes + +- name: droit 755 + file: + path: /var/www/html/adminer + state: directory + mode: '0755' + recurse: yes diff --git a/ansible/roles/doku/tasks/main.yml b/ansible/roles/doku/tasks/main.yml new file mode 100644 index 0000000..ea406d9 --- /dev/null +++ b/ansible/roles/doku/tasks/main.yml @@ -0,0 +1,58 @@ +- name: recuperation dokuwiki-stable.tgz depuis machine depl + get_url: + url: http://depl.sio.lan/store/dokuwiki-stable.tgz + dest: /tmp + +- name: Extraction archive + unarchive: + src: /tmp/dokuwiki-stable.tgz + dest: /var/www/html/ + remote_src: yes + +- name: stat rept + stat: + path: /var/www/html/dokuwiki-2020-07-29 + register: rept_stat + +- name: Renommage de dokuwiki-stable + command: mv /var/www/html/dokuwiki-2020-07-29 /var/www/html/doku + when: not rept_stat.stat.exists + +- name: Droit root recursive + file: + path: /var/www/html/doku + state: directory + recurse: yes + owner: root + group: root + +- name: droit 755 + file: + path: /var/www/html/doku + state: directory + mode: '0755' + recurse: yes + +- name: droit apache data + file: + path: /var/www/html/doku/data + state: directory + owner: www-data + group: www-data + recurse: yes + +- name: droit apache lib + file: + path: /var/www/html/doku/lib + state: directory + owner: www-data + group: www-data + recurse: yes + +- name: droit apache conf + file: + path: /var/www/html/doku/conf + state: directory + owner: www-data + group: www-data + recurse: yes diff --git a/ansible/roles/paquet/tasks/main.yml b/ansible/roles/paquet/tasks/main.yml new file mode 100644 index 0000000..cae34a4 --- /dev/null +++ b/ansible/roles/paquet/tasks/main.yml @@ -0,0 +1,29 @@ +- name: installation apache2 + apt: + name: apache2 + state: present + +- name: installation php + apt: + name: php7.4 + state: present + +- name: installation php-mbstring + apt: + name: php-mbstring + state: present + +- name: installation php-gd + apt: + name: php-gd + state: present + +- name: installation php-xml + apt: + name: php7.4-xml + state: present + +- name: Installation de adminer + apt: + name: adminer + state: present