Some cleanup.

This commit is contained in:
Andrea Dell'Amico 2021-08-11 13:08:52 +02:00
parent a88aaaae08
commit 4d46a7d4e9
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
5 changed files with 42 additions and 10 deletions

View File

@ -43,5 +43,5 @@ dependencies:
version: master
name: memcached
state: latest
when: nextcloud_local_memcached
when: nextcloud_local_memcache

View File

@ -45,9 +45,17 @@
tags: [ 'nextcloud', 'nextcloud_config_cron' ]
- name: Install the nextcloud cron job
cron: user={{ item.user }} minute="*/15" job="php -f {{ item.doc_root }}/cron.php" name="NextCloud cron job"
become_user: root
cron:
user: '{{ item.user }}'
minute: "*/15"
job: "php -f {{ item.doc_root }}/cron.php"
name: "NextCloud cron job"
cron_file: "nextcloud_cron"
state: present
disabled: False
with_items: '{{ phpfpm_pools }}'
tags: [ 'nextcloud', 'nextcloud_config_cron' ]
tags: [ 'nextcloud', 'nextcloud_config_cron', 'nextcloud_config' ]
become: True
become_user: '{{ nextcloud_user }}'

View File

@ -1,7 +1,7 @@
---
- block:
- name: Install the nginx virtualhosts
template: src=nginx-virthost.conf dest=/etc/nginx/sites-available/{{ item.virthost }} owner=root group=root mode=0444
template: src=nginx-virthost.conf.j2 dest=/etc/nginx/sites-available/{{ item.virthost }} owner=root group=root mode=0444
with_items: '{{ phpfpm_pools }}'
notify: Reload nginx

View File

@ -4,8 +4,6 @@ upstream php-handler {
}
server {
listen 80;
listen [::]:80;
server_name {{ item.nginx_servername }};
# enforce https
location ~ /\.(?!well-known).* {
@ -21,8 +19,7 @@ server {
}
server {
listen 443 ssl;
listen [::]:443 ssl;
listen {% if item.https_port is defined %} {{ item.https_port }} {% else %} {{ https_port | default('443') }} {% endif %} ssl {% if ansible_distribution_release != "trusty" %} http2{% endif %};
server_name {{ item.nginx_servername }};
include /etc/nginx/snippets/nginx-server-ssl.conf;

View File

@ -42,7 +42,34 @@ nextcloud_php_global_settings:
php_cli_global_settings: '{{ php_global_settings }}'
nextcloud_phpfpm_pools:
- { pool_name: '{{ phpfpm_default_pool_name }}', app_context: '{{ phpfpm_default_context }}', user: '{{ phpfpm_default_user }}', group: '{{ phpfpm_default_group }}', listen: '{{ phpfpm_default_listen }}', allowed_clients: '{{ phpfpm_default_allowed_clients }}', pm: '{{ phpfpm_default_pm }}', pm_max_children: '{{ phpfpm_default_pm_max_children }}', pm_start_servers: '{{ phpfpm_default_pm_start_servers }}', pm_min_spare: '{{ phpfpm_default_pm_min_spare_servers }}', pm_max_spare: '{{ phpfpm_default_pm_max_spare_servers }}', pm_max_requests: '{{ phpfpm_default_pm_max_requests }}', pm_status_enabled: '{{ phpfpm_default_pm_status_enabled }}', pm_status_path: '{{ phpfpm_default_pm_status_path }}', ping_enabled: '{{ phpfpm_default_ping_enabled }}', ping_path: '{{ phpfpm_default_ping_path }}', ping_response: '{{ phpfpm_default_ping_response }}', display_errors: '{{ phpfpm_default_display_errors }}', log_errors: '{{ phpfpm_default_log_errors }}', memory_limit: '{{ nextcloud_phpfpm_default_memory_limit }}', slowlog_timeout: '{{ phpfpm_default_slowlog_timeout }}', rlimit_files: '{{ phpfpm_default_rlimit_files }}', php_extensions: '{{ phpfpm_default_extensions }}', define_custom_variables: '{{ phpfpm_default_define_custom_variables }}', doc_root: '{{ nextcloud_web_root }}', req_term_timeout: '240s', virthost: '{{ nextcloud_servername }}', nginx_servername: '{{ nextcloud_servername }}' }
- pool_name: '{{ phpfpm_default_pool_name }}'
app_context: '{{ phpfpm_default_context }}'
user: '{{ phpfpm_default_user }}'
group: '{{ phpfpm_default_group }}'
listen: '{{ phpfpm_default_listen }}'
allowed_clients: '{{ phpfpm_default_allowed_clients }}'
pm: '{{ phpfpm_default_pm }}'
pm_max_children: '{{ phpfpm_default_pm_max_children }}'
pm_start_servers: '{{ phpfpm_default_pm_start_servers }}'
pm_min_spare: '{{ phpfpm_default_pm_min_spare_servers }}'
pm_max_spare: '{{ phpfpm_default_pm_max_spare_servers }}'
pm_max_requests: '{{ phpfpm_default_pm_max_requests }}'
pm_status_enabled: '{{ phpfpm_default_pm_status_enabled }}'
pm_status_path: '{{ phpfpm_default_pm_status_path }}'
ping_enabled: '{{ phpfpm_default_ping_enabled }}'
ping_path: '{{ phpfpm_default_ping_path }}'
ping_response: '{{ phpfpm_default_ping_response }}'
display_errors: '{{ phpfpm_default_display_errors }}'
log_errors: '{{ phpfpm_default_log_errors }}'
memory_limit: '{{ nextcloud_phpfpm_default_memory_limit }}'
slowlog_timeout: '{{ phpfpm_default_slowlog_timeout }}'
rlimit_files: '{{ phpfpm_default_rlimit_files }}'
php_extensions: '{{ phpfpm_default_extensions }}'
define_custom_variables: '{{ phpfpm_default_define_custom_variables }}'
doc_root: '{{ nextcloud_web_root }}'
req_term_timeout: '240s'
virthost: '{{ nextcloud_servername }}'
nginx_servername: '{{ nextcloud_servername }}'