Migrate nextcloud

This commit is contained in:
Salt 2020-02-20 05:28:39 -06:00
parent 9f2d80ffdb
commit f2237a8e00

View File

@ -75,32 +75,19 @@
name: "nextcloud-cron" name: "nextcloud-cron"
minute: "*/5" minute: "*/5"
job: 'php -f "{{ nextcloud_webroot }}/cron.php"' job: 'php -f "{{ nextcloud_webroot }}/cron.php"'
- name: Register certificates - name: Copy over virtual host configs
block: template:
# Note: We copy over some insecure configs now src: apache2-vhost-ssl.conf
# Reason being there's no way for the https role to handle every site's dest: "/etc/apache2/sites-enabled/{{ nextcloud_url }}.conf"
# configuration on its own. If it doesn't have to update the key, it - name: Generate certificate
# won't reload Apache and our site will never actually see https downtime include_role:
- name: Configure insecure virtual host configs name: https
template: vars:
src: apache2-vhost.conf website_url: "{{ nextcloud_url }}"
dest: "/etc/apache2/sites-enabled/{{ nextcloud_url }}.conf" website_webroot: "{{ nextcloud_webroot }}"
- name: Generate certificate - name: Reload Apache
include_role: service:
name: https name: apache2
vars: state: reloaded
website_url: "{{ nextcloud_url }}" enabled: true
website_webroot: "{{ nextcloud_webroot }}"
- name: Secure Apache
block:
# If we copied over http-only configs before, they get oblooterated now
- name: Copy over virtual host configs
template:
src: apache2-vhost-ssl.conf
dest: "/etc/apache2/sites-enabled/{{ nextcloud_url }}.conf"
- name: Reload Apache
service:
name: apache2
state: reloaded
enabled: true
become: yes become: yes