From 166cc2bfe3580938960fa43e316748595eaa58b1 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 13 Oct 2022 09:34:32 +0200 Subject: [PATCH] Fin Ansible --- Sio2/SISR/40-ansible/local.yml | 5 ++++ Sio2/SISR/40-ansible/maindoku.yml | 45 +++++++++++++++++++++++++++++++ Sio2/SISR/40-ansible/mainweb.yml | 11 ++++++++ 3 files changed, 61 insertions(+) create mode 100644 Sio2/SISR/40-ansible/local.yml create mode 100644 Sio2/SISR/40-ansible/maindoku.yml create mode 100644 Sio2/SISR/40-ansible/mainweb.yml diff --git a/Sio2/SISR/40-ansible/local.yml b/Sio2/SISR/40-ansible/local.yml new file mode 100644 index 0000000..7b3d91e --- /dev/null +++ b/Sio2/SISR/40-ansible/local.yml @@ -0,0 +1,5 @@ +--- +- hosts: infra + roles: + - web + - doku diff --git a/Sio2/SISR/40-ansible/maindoku.yml b/Sio2/SISR/40-ansible/maindoku.yml new file mode 100644 index 0000000..9154572 --- /dev/null +++ b/Sio2/SISR/40-ansible/maindoku.yml @@ -0,0 +1,45 @@ +- name: recuperation archive et decompression dans /tmp + unarchive: + src: http://depl/store/dokuwiki-stable.tgz + dest: /var/www/html + remote_src: yes + +- name: renommer le dossier et deplacer + stat: + path: /var/www/html/dokuwiki-2022-07-31a + register: dokuwiki_status + +- name: check si dokuwiki deja installe + stat: + path: /var/www/html/doku + register: doku_status + +- name: sortie si dokuwiki est deja installe + fail: + msg: "dokuwiki deja installe dans /var/www/html/doku" + when: doku_status.stat.exists + +- name: renomme dokuwiki-2022-07-31a + command: "mv /var/www/html/dokuwiki-2022-07-31a /var/www/html/doku" + when: dokuwiki_status.stat.exists + +- name: les droits dokuwiki + file: + path: /var/www/html/doku + state: directory + recurse: yes + owner: root + group: root + mode: 0755 + +- name: droits de www-data + file: + path: "/var/www/html/doku/{{ item }}" + state: directory + recurse: yes + owner: www-data + group: www-data + with_items: + - data + - lib + - conf diff --git a/Sio2/SISR/40-ansible/mainweb.yml b/Sio2/SISR/40-ansible/mainweb.yml new file mode 100644 index 0000000..ad85715 --- /dev/null +++ b/Sio2/SISR/40-ansible/mainweb.yml @@ -0,0 +1,11 @@ +--- +- name: installation apache2 php php-gd php-mbstring + apt: + pkg: + - apache2 + - php + - php-gd + - php-xml + - php-mbstring + state: present +