Skip to content
Snippets Groups Projects
Commit 279472f8 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting [skip-ci]

parent 8247f38b
No related branches found
No related tags found
No related merge requests found
...@@ -3,25 +3,27 @@ ...@@ -3,25 +3,27 @@
- block: - block:
- name: Apache Configuration File - name: Apache Configuration File
template: template:
src='vhost.conf' src: vhost.conf
dest='/etc/apache2/sites-available/{{ matomo.domain }}{{ apache_conf_ext }}' dest: /etc/apache2/sites-available/{{ matomo.domain }}{{ apache_conf_ext }}
owner='root' owner: root
group='root' group: root
mode='664' mode: 0664
notify: notify:
- "Apache | Restart 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 }} command: a2ensite {{ matomo.domain }}
notify: args:
- "Apache | Restart Apache" creates: /etc/apache2/sites-enabled/{{ matomo.domain }}{{ apache_conf_ext }}
notify:
- "Restart Apache"
- name: Apache install GeoIP - name: Apache install GeoIP
apt: apt:
pkg: libapache2-mod-geoip pkg: libapache2-mod-geoip
state: present state: present
tags: tags:
- ApacheConfig - ApacheConfig
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
- block: - block:
- set_fact: - set_fact:
webRoot='/var/www/matomo/{{ matomo.id }}' webRoot: /var/www/matomo/{{ matomo.id }}
apacheUser='www-data' apacheUser: www-data
apacheLogDir='/var/log/apache2' apacheLogDir: /var/log/apache2
when: matomo.jail is not defined when: matomo.jail is not defined
- set_fact: - set_fact:
webRoot='{{ jailroot }}/{{ matomo.id }}/var/www/matomo' webRoot: '{{ jailroot }}/{{ matomo.id }}/var/www/matomo'
apacheUser='{{ matomo.id }}' apacheUser: '{{ matomo.id }}'
apacheLogDir='{{ jailroot }}/{{ matomo.id }}/var/log/apache2' apacheLogDir: '{{ jailroot }}/{{ matomo.id }}/var/log/apache2'
when: matomo.jail is defined when: matomo.jail is defined
tags: tags:
- always - always
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
- name: Ensure Root Directories - name: Ensure Root Directories
file: file:
path='{{ item }}' path: '{{ item }}'
state='directory' state: directory
owner='{{ apacheUser }}' owner: '{{ apacheUser }}'
group='{{ apacheUser }}' group: '{{ apacheUser }}'
mode='775' mode: 0775
with_items: with_items:
- {{ webRoot }} - {{ webRoot }}
tags: tags:
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
- name: File Modes and Ownership - name: File Modes and Ownership
file: file:
path='{{ webRoot }}' path: '{{ webRoot }}'
owner='{{ apacheUser }}' owner: '{{ apacheUser }}'
group='{{ apacheUser }}' group: '{{ apacheUser }}'
mode='g+w' mode: g+w
recurse=yes recurse: yes
follow=no follow: no
tags: tags:
- deploy - deploy
...@@ -69,32 +69,32 @@ ...@@ -69,32 +69,32 @@
- name: Configuration file - name: Configuration file
template: template:
src='config.ini.php' src: config.ini.php
dest='{{ webRoot }}/config/config.ini.php' dest: '{{ webRoot }}/config/config.ini.php'
owner='{{ apacheUser }}' owner: '{{ apacheUser }}'
group='{{ apacheUser }}' group: '{{ apacheUser }}'
mode='664' mode: 0664
tags: tags:
- deploy - deploy
- name: Composer - name: Composer
composer: composer:
command='update' command: update
working_dir='{{ webRoot }}' working_dir: '{{ webRoot }}'
no_dev=yes no_dev: yes
optimize_autoloader=yes optimize_autoloader: yes
prefer_dist=yes prefer_dist: yes
ignore_errors: true ignore_errors: yes
tags: tags:
- deploy - deploy
- name: Ensure Working Directories - name: Ensure Working Directories
file: file:
path='{{ item }}' path: '{{ item }}'
state='directory' state: directory
owner='{{ apacheUser }}' owner: '{{ apacheUser }}'
group='{{ apacheUser }}' group: '{{ apacheUser }}'
mode='775' mode: 0775
with_items: with_items:
- {{ webRoot }}/tmp - {{ webRoot }}/tmp
tags: tags:
...@@ -102,45 +102,45 @@ ...@@ -102,45 +102,45 @@
- name: File Modes and Ownership - name: File Modes and Ownership
file: file:
path='{{ webRoot }}' path: '{{ webRoot }}'
owner='{{ apacheUser }}' owner: '{{ apacheUser }}'
group='{{ apacheUser }}' group: '{{ apacheUser }}'
mode='a-w' mode: a-w
recurse=yes recurse: yes
follow=no follow: no
tags: tags:
- deploy - deploy
- name: File Modes for .git Directory - name: File Modes for .git Directory
file: file:
path='{{ webRoot }}/.git' path: '{{ webRoot }}/.git'
mode='og+w' mode: og+w
recurse=yes recurse: yes
follow=no follow: no
tags: tags:
- deploy - deploy
- name: File Modes for tmp - name: File Modes for tmp
file: file:
path='{{ webRoot }}/tmp' path: '{{ webRoot }}/tmp'
mode='ug+w' mode: ug+w
recurse=yes recurse: yes
follow=no follow: no
tags: tags:
- deploy - deploy
- name: Ensure Database - name: Ensure Database
mysql_db: mysql_db:
name='matomo_{{ matomo.id }}' name: matomo_{{ matomo.id }}
login_user='root' login_user: root
login_password='{{ mysql_root_password|default("root") }}' login_password: '{{ mysql_root_password|default("root") }}'
login_host='127.0.0.1' login_host: 127.0.0.1
login_port='{{ matomo.db_port|default('3306') }}' login_port: '{{ matomo.db_port|default('3306') }}'
state='present' state: present
- name: Run Upgrade - name: Run Upgrade
command: '{{ webRoot }}/console core:update --yes --no-interaction' command: '{{ webRoot }}/console core:update --yes --no-interaction'
become_user: '{{ apacheUser }}' become_user: '{{ apacheUser }}'
ignore_errors: true ignore_errors: yes
tags: tags:
- deploy - deploy
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