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

ansible-playbooks/general#85 Linting

parent 4ddf9ce8
No related branches found
No related tags found
No related merge requests found
---
nextcloud_version: 16.0.1
nextcloud_plugins:
- announcementcenter
......
......@@ -25,7 +25,7 @@
- name: Apache enable our new site(s)
command: a2ensite nextcloud-{{ nextcloud.id }}
args
args:
creates: /etc/apache2/sites-enabled/nextcloud-{{ nextcloud.id }}{{ apache_conf_ext }}
notify:
- Restart Apache
......
......@@ -2,20 +2,20 @@
# file: roles/nextcloud/tasks/install.yml
- block:
- set_fact:
installed: '{{ nextcloud.config.instanceid != "" }}'
- set_fact:
webRoot: /var/www/nextcloud/{{ nextcloud.id }}
dataRoot: '{{ nextcloud_data_dir|default("/var/www/nextcloud/_data") }}/{{ nextcloud.id }}'
apacheUser: www-data
apacheLogDir: /var/log/apache2
when: nextcloud.jail is not defined
- set_fact:
webRoot: '{{ jailroot }}/{{ nextcloud.id }}/var/www/nextcloud'
dataRoot: '{{ jailroot }}/{{ nextcloud.id }}/var/www/datanextcloud'
apacheUser: '{{ nextcloud.id }}'
apacheLogDir: '{{ jailroot }}/{{ nextcloud.id }}/var/log/apache2'
when: nextcloud.jail is defined
- set_fact:
installed: '{{ nextcloud.config.instanceid != "" }}'
- set_fact:
webRoot: /var/www/nextcloud/{{ nextcloud.id }}
dataRoot: '{{ nextcloud_data_dir|default("/var/www/nextcloud/_data") }}/{{ nextcloud.id }}'
apacheUser: www-data
apacheLogDir: /var/log/apache2
when: nextcloud.jail is not defined
- set_fact:
webRoot: '{{ jailroot }}/{{ nextcloud.id }}/var/www/nextcloud'
dataRoot: '{{ jailroot }}/{{ nextcloud.id }}/var/www/datanextcloud'
apacheUser: '{{ nextcloud.id }}'
apacheLogDir: '{{ jailroot }}/{{ nextcloud.id }}/var/log/apache2'
when: nextcloud.jail is defined
tags:
- always
......@@ -211,33 +211,33 @@
- block:
- name: Enable Plugins
command: '{{ webRoot }}/occ app:enable {{ item.id }} --no-interaction --no-warnings'
become_user: '{{ apacheUser }}'
ignore_errors: yes
with_items: '{{ nextcloud_plugins_public }}'
when: item.latest_release.version != plugin_versions[item.id]|default('0.0.0')
tags:
- deploy
- plugins
- name: Run Upgrade
command: '{{ webRoot }}/occ upgrade --no-interaction --no-warnings'
become_user: '{{ apacheUser }}'
ignore_errors: yes
tags:
- deploy
- plugins
- name: Enable Plugins
command: '{{ webRoot }}/occ app:enable {{ item.id }} --no-interaction --no-warnings'
become_user: '{{ apacheUser }}'
ignore_errors: yes
with_items: '{{ nextcloud_plugins_public }}'
when: item.latest_release.version != plugin_versions[item.id]|default('0.0.0')
tags:
- deploy
- plugins
- name: Enable Plugins
command: '{{ webRoot }}/occ app:enable {{ item.id }} --no-interaction --no-warnings'
become_user: '{{ apacheUser }}'
ignore_errors: yes
with_items: '{{ nextcloud_plugins_public }}'
when: item.latest_release.version != plugin_versions[item.id]|default('0.0.0')
tags:
- deploy
- plugins
- name: Run Upgrade
command: '{{ webRoot }}/occ upgrade --no-interaction --no-warnings'
become_user: '{{ apacheUser }}'
ignore_errors: yes
tags:
- deploy
- plugins
- name: Enable Plugins
command: '{{ webRoot }}/occ app:enable {{ item.id }} --no-interaction --no-warnings'
become_user: '{{ apacheUser }}'
ignore_errors: yes
with_items: '{{ nextcloud_plugins_public }}'
when: item.latest_release.version != plugin_versions[item.id]|default('0.0.0')
tags:
- deploy
- plugins
when: installed
......
......@@ -8,95 +8,95 @@
- always
- block:
- name: Install Certs
include_tasks: ../../letsencrypt/tasks/cert.yml
with_items: '{{ nextcloud_settings|default([]) }}'
loop_control:
loop_var: domain
when: domain.protocol|default("https") == "https" and domain.letsencrypt|default(true)
- name: Install Certs
include_tasks: ../../letsencrypt/tasks/cert.yml
with_items: '{{ nextcloud_settings|default([]) }}'
loop_control:
loop_var: domain
when: domain.protocol|default("https") == "https" and domain.letsencrypt|default(true)
when: not excluded_roles or "letsencrypt" not in excluded_roles and groups.proxyserver is not defined
- block:
- name: Ensure Download Directory
file:
path: /opt/nextcloud-downloads
state: directory
tags:
- always
- name: Ensure Download Directory
file:
path: /opt/nextcloud-downloads
state: directory
tags:
- always
- name: List Downlaods
shell: ls /opt/nextcloud-downloads -1
register: download_list
tags:
- always
- name: List Downlaods
shell: ls /opt/nextcloud-downloads -1
register: download_list
tags:
- always
- name: Lookup Plugins
set_fact:
nextcloud_plugins_public: '{{ lookup("nextcloud_plugins", "{{ nextcloud_version }}") }}'
run_once: true
delegate_to: localhost
tags:
- always
- name: Lookup Plugins
set_fact:
nextcloud_plugins_public: '{{ lookup("nextcloud_plugins", "{{ nextcloud_version }}") }}'
run_once: yes
delegate_to: localhost
tags:
- always
- name: Download Archive
get_url:
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.zip
dest: /opt/nextcloud-downloads/nextcloud-{{ nextcloud_version }}.zip
when: download_list and ['nextcloud-', nextcloud_version, '.zip']|join('') not in download_list.stdout_lines
tags:
- deploy
- name: Download Archive
get_url:
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.zip
dest: /opt/nextcloud-downloads/nextcloud-{{ nextcloud_version }}.zip
when: download_list and ['nextcloud-', nextcloud_version, '.zip']|join('') not in download_list.stdout_lines
tags:
- deploy
- name: Download Plugins
get_url:
url: '{{ item.latest_release.download }}'
dest: /opt/nextcloud-downloads/{{ item.id }}-{{ item.latest_release.version }}.tar.gz
with_items: '{{ nextcloud_plugins_public }}'
when: item.needs_download
tags:
- deploy
- plugins
- name: Download Plugins
get_url:
url: '{{ item.latest_release.download }}'
dest: /opt/nextcloud-downloads/{{ item.id }}-{{ item.latest_release.version }}.tar.gz
with_items: '{{ nextcloud_plugins_public }}'
when: item.needs_download
tags:
- deploy
- plugins
- name: Ensure Log Directory
file:
path: /var/log/nextcloud
state: directory
owner: www-data
group: www-data
mode: 0775
tags:
- ApacheConfig
- name: Ensure Log Directory
file:
path: /var/log/nextcloud
state: directory
owner: www-data
group: www-data
mode: 0775
tags:
- ApacheConfig
- name: Install logrotate script
template:
src: etc-logrotate-nextcloud
dest: /etc/logrotate.d/nextcloud
owner: root
group: root
mode: 0644
tags:
- ApacheConfig
- logrotate
- name: Install logrotate script
template:
src: etc-logrotate-nextcloud
dest: /etc/logrotate.d/nextcloud
owner: root
group: root
mode: 0644
tags:
- ApacheConfig
- logrotate
- name: Install NextCloud
include_tasks: install.yml
with_items: '{{ nextcloud_settings|default([]) }}'
loop_control:
loop_var: nextcloud
when: limit_site is not defined or limit_site == 'no' or nextcloud.id is not defined or limit_site == nextcloud.id
tags:
- ApacheConfig
- cron
- deploy
- plugins
- name: Install NextCloud
include_tasks: install.yml
with_items: '{{ nextcloud_settings|default([]) }}'
loop_control:
loop_var: nextcloud
when: limit_site is not defined or limit_site == 'no' or nextcloud.id is not defined or limit_site == nextcloud.id
tags:
- ApacheConfig
- cron
- deploy
- plugins
- name: Install Collabora server
include_tasks: collabora.yml
- name: Install Collabora server
include_tasks: collabora.yml
- name: Install TURN server
include_tasks: turn.yml
- name: Install TURN server
include_tasks: turn.yml
- name: Install tesseract
include_tasks: tesseract.yml
- name: Install tesseract
include_tasks: tesseract.yml
when: not excluded_roles or "nextcloud" 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