Roundcube playbook

This commit is contained in:
Michael RICOIS 2016-07-29 10:24:30 +02:00
parent 4520e759c6
commit d8f8e0c9ee

View File

@ -0,0 +1,30 @@
---
# This playbook install roundcubemail
- hosts: all
vars:
version: 1.2.1
vhosts: /home/vhosts/roundcubemail
opcache: fcgi
keep_releases: 3
become: yes
tasks:
- name: ROUNDCUBE | Download
get_url: url="https://github.com/roundcube/roundcubemail/releases/download/{{ version }}/roundcubemail-{{ version }}-complete.tar.gz" dest="{{ vhosts }}/releases/roundcubemail-{{ version }}" validate_certs=no
- name: ROUNDCUBE | Extract
unarchive: src="{{ vhosts }}/releases/roundcubemail-{{ version }}-complete.tar.gz" dest="{{ vhosts }}/releases/" copy=no
- name: ROUNDCUBE | Delete
file: path="{{ vhosts }}/releases/roundcubemail-{{ version }}-complete.tar.gz" state=absent
- name: ROUNDCUBE | Config
copy: src="./config/config.inc.php" dest="{{ vhosts }}/releases/roundcubemail-{{ version }}/config/config.inc.php"
- name: ROUNDCUBE | .user.ini
copy: src="./config/.user.ini" dest="{{ vhosts }}/releases/roundcubemail-{{ version }}/.user.ini"
- name: ROUNDCUBE | Permission
file: path="{{ vhosts }}/releases/roundcubemail-{{ version }}" owner=www-data group=www-data
- name: ROUNDCUBE | Symlink
file: src="{{ vhosts }}/releases/roundcubemail-{{ version }}" dest="{{ vhosts }}/current" owner=www-data group=www-data state=link
- name: ROUNDCUBE | Opcache
command: "/usr/bin/php /home/deploy/cachetool.phar opcache:reset --fcgi=/var/run/php5-fpm.sock"
when: opcache is defined and opcache == "fcgi"
- name: ROUNDCUBE | Cleanup
shell: ls -1dt {{ vhosts }}/releases/* | tail -n +{{ keep_releases | int + 1 }} | xargs rm -rf
when: keep_releases > 0