Improved variables

- removed default variables with unusable values
- exchanged ansible_domain with collabora_domain where applicable
This commit is contained in:
2020-01-04 01:06:10 +01:00
parent ec49e08643
commit 5e9393a4b9
6 changed files with 16 additions and 20 deletions
-3
View File
@@ -1,3 +0,0 @@
---
nextcloud_domain: nextcloud.com
admin_mail: admin@example.com
+4 -4
View File
@@ -2,7 +2,7 @@
- name: add collabora http site
template:
src: etc/apache2/sites-available/ansible_domain.conf.j2
dest: /etc/apache2/sites-available/{{ ansible_domain }}.conf
dest: /etc/apache2/sites-available/{{ collabora_domain }}.conf
owner: root
group: root
mode: 0644
@@ -13,7 +13,7 @@
cmd: a2dissite 000-default.conf
- name: enable collabora site
command:
cmd: a2ensite {{ ansible_domain }}.conf
cmd: a2ensite {{ collabora_domain }}.conf
- name: run certbot
command:
cmd: certbot --apache --non-interactive --keep-until-expiring --no-eff-email --email {{ admin_mail }} --redirect --renew-with-new-domains --agree-tos -d {{ ansible_domain }}
@@ -23,11 +23,11 @@
- name: add collabora https site
template:
src: etc/apache2/sites-available/ansible_domain-le-ssl.conf.j2
dest: /etc/apache2/sites-available/{{ ansible_domain }}-le-ssl.conf
dest: /etc/apache2/sites-available/{{ collabora_domain }}-le-ssl.conf
owner: root
group: root
mode: 0644
- name: enable collabora https site
command:
cmd: a2ensite {{ ansible_domain }}-le-ssl.conf
cmd: a2ensite {{ collabora_domain }}-le-ssl.conf
notify: restart apache
+8 -8
View File
@@ -14,22 +14,22 @@
- name: Ensure directory exists for local self-signed TLS certs.
file:
path: /etc/letsencrypt/live/{{ ansible_domain }}
path: /etc/letsencrypt/live/{{ collabora_domain }}
state: directory
- name: Generate an OpenSSL private key.
openssl_privatekey:
path: /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem
path: /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
- name: Generate an OpenSSL CSR.
openssl_csr:
path: /etc/ssl/private/{{ ansible_domain }}.csr
privatekey_path: /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem
common_name: "{{ ansible_domain }}"
path: /etc/ssl/private/{{ collabora_domain }}.csr
privatekey_path: /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
common_name: "{{ collabora_domain }}"
- name: Generate a Self Signed OpenSSL certificate.
openssl_certificate:
path: /etc/letsencrypt/live/{{ ansible_domain }}/fullchain.pem
privatekey_path: /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem
csr_path: /etc/ssl/private/{{ ansible_domain }}.csr
path: /etc/letsencrypt/live/{{ collabora_domain }}/fullchain.pem
privatekey_path: /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
csr_path: /etc/ssl/private/{{ collabora_domain }}.csr
provider: selfsigned
@@ -1,12 +1,12 @@
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName {{ ansible_domain }}
ServerName {{ collabora_domain }}
ServerAdmin {{ admin_mail }}
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/{{ ansible_domain }}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/{{ collabora_domain }}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
# Encoded slashes need to be allowed
@@ -1,5 +1,5 @@
<VirtualHost *:80>
ServerName {{ ansible_domain }}
ServerName {{ collabora_domain }}
ServerAdmin {{ admin_mail }}
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined