Newer
Older
---
# file: roles/matomo/tasks/install.yml
- block:
- set_fact:
webRoot='/var/www/matomo/{{ matomo.id }}'
apacheUser='www-data'
apacheLogDir='/var/log/apache2'
when: matomo.jail is not defined
- set_fact:
webRoot='{{ jailroot }}/{{ matomo.id }}/var/www/matomo'
apacheUser='{{ matomo.id }}'
apacheLogDir='{{ jailroot }}/{{ matomo.id }}/var/log/apache2'
when: matomo.jail is defined
file:
path='{{ item }}'
state='directory'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='775'
with_items:
file:
path='{{ webRoot }}'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='g+w'
recurse=yes
follow=no
repo: git@github.com:matomo-org/matomo.git
dest: '{{ webRoot }}'
track_submodules: yes
force: yes
version: '{{ matomo_version }}'
become: false
environment:
GIT_LFS_SKIP_SMUDGE: 1
tags:
- deploy
template:
src='config.ini.php'
dest='{{ webRoot }}/config/config.ini.php'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='664'
composer:
command='update'
working_dir='{{ webRoot }}'
no_dev=yes
optimize_autoloader=yes
prefer_dist=yes
ignore_errors: true
file:
path='{{ item }}'
state='directory'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='775'
with_items:
- {{ webRoot }}/tmp
tags:
- always
file:
path='{{ webRoot }}'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='a-w'
recurse=yes
follow=no
file:
path='{{ webRoot }}/.git'
mode='og+w'
recurse=yes
follow=no
file:
path='{{ webRoot }}/tmp'
mode='ug+w'
recurse=yes
follow=no
mysql_db:
name='matomo_{{ matomo.id }}'
login_user='root'
login_password='{{ mysql_root_password|default("root") }}'
login_host='127.0.0.1'
login_port='{{ matomo.db_port|default('3306') }}'
state='present'
command: '{{ webRoot }}/console core:update --yes --no-interaction'
become_user: '{{ apacheUser }}'
ignore_errors: true