Fin Ansible

This commit is contained in:
Louis 2022-10-13 09:34:32 +02:00
parent 100f6bcfef
commit 166cc2bfe3
3 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
- hosts: infra
roles:
- web
- doku

View File

@ -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

View File

@ -0,0 +1,11 @@
---
- name: installation apache2 php php-gd php-mbstring
apt:
pkg:
- apache2
- php
- php-gd
- php-xml
- php-mbstring
state: present