Skip to content
Snippets Groups Projects
Commit 8247f38b authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting

parent a6c6b1e2
No related branches found
No related tags found
No related merge requests found
matomo_version: '3.9.1'
matomo_version: 3.9.1
matomo_force_reset: False
......@@ -3,7 +3,7 @@
- block:
- name: "Apache Configuration File"
- name: Apache Configuration File
template:
src='vhost.conf'
dest='/etc/apache2/sites-available/{{ matomo.domain }}{{ apache_conf_ext }}'
......@@ -13,14 +13,15 @@
notify:
- "Apache | Restart Apache"
- name: "Apache enable our new site(s)"
- name: Apache enable our new site(s)
command: a2ensite {{ matomo.domain }} creates=/etc/apache2/sites-enabled/{{ matomo.domain }}{{ apache_conf_ext }}
notify:
- "Apache | Restart Apache"
- name: "Apache install GeoIP"
- name: Apache install GeoIP
apt:
pkg: 'libapache2-mod-geoip'
state: 'present'
pkg: libapache2-mod-geoip
state: present
tags: 'ApacheConfig'
tags:
- ApacheConfig
......@@ -12,22 +12,25 @@
apacheUser='{{ matomo.id }}'
apacheLogDir='{{ jailroot }}/{{ matomo.id }}/var/log/apache2'
when: matomo.jail is defined
tags: 'always'
tags:
- always
- name: "Configure Apache"
- name: Configure Apache
include_tasks: apache.yml
tags: 'ApacheConfig'
tags:
- ApacheConfig
- name: "Remove existing components"
- name: Remove existing components
file:
path: '{{ item }}'
state: 'absent'
state: absent
with_items:
- '{{ webRoot }}'
- {{ webRoot }}
when: matomo_force_reset
tags: 'always'
tags:
- always
- name: "Ensure Root Directories"
- name: Ensure Root Directories
file:
path='{{ item }}'
state='directory'
......@@ -35,10 +38,11 @@
group='{{ apacheUser }}'
mode='775'
with_items:
- '{{ webRoot }}'
tags: 'always'
- {{ webRoot }}
tags:
- always
- name: "File Modes and Ownership"
- name: File Modes and Ownership
file:
path='{{ webRoot }}'
owner='{{ apacheUser }}'
......@@ -46,31 +50,34 @@
mode='g+w'
recurse=yes
follow=no
tags: 'deploy'
tags:
- deploy
- name: "Clone Git Repository"
- name: Clone Git Repository
git:
accept_hostkey: yes
repo: 'git@github.com:matomo-org/matomo.git'
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'
GIT_LFS_SKIP_SMUDGE: 1
tags:
- deploy
- name: "Configuration file"
- name: Configuration file
template:
src='config.ini.php'
dest='{{ webRoot }}/config/config.ini.php'
owner='{{ apacheUser }}'
group='{{ apacheUser }}'
mode='664'
tags: 'deploy'
tags:
- deploy
- name: "Composer"
- name: Composer
composer:
command='update'
working_dir='{{ webRoot }}'
......@@ -78,9 +85,10 @@
optimize_autoloader=yes
prefer_dist=yes
ignore_errors: true
tags: 'deploy'
tags:
- deploy
- name: "Ensure Working Directories"
- name: Ensure Working Directories
file:
path='{{ item }}'
state='directory'
......@@ -88,10 +96,11 @@
group='{{ apacheUser }}'
mode='775'
with_items:
- '{{ webRoot }}/tmp'
tags: 'always'
- {{ webRoot }}/tmp
tags:
- always
- name: "File Modes and Ownership"
- name: File Modes and Ownership
file:
path='{{ webRoot }}'
owner='{{ apacheUser }}'
......@@ -99,25 +108,28 @@
mode='a-w'
recurse=yes
follow=no
tags: 'deploy'
tags:
- deploy
- name: "File Modes for .git Directory"
- name: File Modes for .git Directory
file:
path='{{ webRoot }}/.git'
mode='og+w'
recurse=yes
follow=no
tags: 'deploy'
tags:
- deploy
- name: "File Modes for tmp"
- name: File Modes for tmp
file:
path='{{ webRoot }}/tmp'
mode='ug+w'
recurse=yes
follow=no
tags: 'deploy'
tags:
- deploy
- name: "Ensure Database"
- name: Ensure Database
mysql_db:
name='matomo_{{ matomo.id }}'
login_user='root'
......@@ -126,8 +138,9 @@
login_port='{{ matomo.db_port|default('3306') }}'
state='present'
- name: "Run Upgrade"
- name: Run Upgrade
command: '{{ webRoot }}/console core:update --yes --no-interaction'
become_user: '{{ apacheUser }}'
ignore_errors: true
tags: 'deploy'
tags:
- deploy
---
# file: roles/matomo/tasks/main.yml
- name: "matomo Role"
set_fact: role_matomo_started=true
tags: 'always'
- name: matomo Role
set_fact:
role_matomo_started: yes
tags:
- always
- block:
- name: "Install Certs"
include_tasks: '../../letsencrypt/tasks/cert.yml'
- name: Install Certs
include_tasks: ../../letsencrypt/tasks/cert.yml
with_items: '{{ matomo_settings|default([]) }}'
loop_control:
loop_var: domain
when: domain.protocol|default("https") == "https" and domain.letsencrypt|default(true)
tags: 'ApacheConfig'
tags:
- ApacheConfig
when: '"letsencrypt" not in excluded_roles and groups.proxyserver is not defined'
when: not excluded_roles or "letsencrypt" not in excluded_roles and groups.proxyserver is not defined
- block:
- name: "Install matomo"
- name: Install matomo
include_tasks: install.yml
with_items: '{{ matomo_settings|default([]) }}'
loop_control:
loop_var: matomo
when: limit_site is not defined or limit_site == 'False' or matomo.id is not defined or limit_site == matomo.id
tags:
- 'ApacheConfig'
- 'deploy'
- ApacheConfig
- deploy
when: '"matomo" not in excluded_roles'
when: not excluded_roles or "matomo" not in excluded_roles
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment