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 - name: add collabora http site
template: template:
src: etc/apache2/sites-available/ansible_domain.conf.j2 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 owner: root
group: root group: root
mode: 0644 mode: 0644
@@ -13,7 +13,7 @@
cmd: a2dissite 000-default.conf cmd: a2dissite 000-default.conf
- name: enable collabora site - name: enable collabora site
command: command:
cmd: a2ensite {{ ansible_domain }}.conf cmd: a2ensite {{ collabora_domain }}.conf
- name: run certbot - name: run certbot
command: 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 }} 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 - name: add collabora https site
template: template:
src: etc/apache2/sites-available/ansible_domain-le-ssl.conf.j2 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 owner: root
group: root group: root
mode: 0644 mode: 0644
- name: enable collabora https site - name: enable collabora https site
command: command:
cmd: a2ensite {{ ansible_domain }}-le-ssl.conf cmd: a2ensite {{ collabora_domain }}-le-ssl.conf
notify: restart apache notify: restart apache
+8 -8
View File
@@ -14,22 +14,22 @@
- name: Ensure directory exists for local self-signed TLS certs. - name: Ensure directory exists for local self-signed TLS certs.
file: file:
path: /etc/letsencrypt/live/{{ ansible_domain }} path: /etc/letsencrypt/live/{{ collabora_domain }}
state: directory state: directory
- name: Generate an OpenSSL private key. - name: Generate an OpenSSL private key.
openssl_privatekey: openssl_privatekey:
path: /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem path: /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
- name: Generate an OpenSSL CSR. - name: Generate an OpenSSL CSR.
openssl_csr: openssl_csr:
path: /etc/ssl/private/{{ ansible_domain }}.csr path: /etc/ssl/private/{{ collabora_domain }}.csr
privatekey_path: /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem privatekey_path: /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
common_name: "{{ ansible_domain }}" common_name: "{{ collabora_domain }}"
- name: Generate a Self Signed OpenSSL certificate. - name: Generate a Self Signed OpenSSL certificate.
openssl_certificate: openssl_certificate:
path: /etc/letsencrypt/live/{{ ansible_domain }}/fullchain.pem path: /etc/letsencrypt/live/{{ collabora_domain }}/fullchain.pem
privatekey_path: /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem privatekey_path: /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
csr_path: /etc/ssl/private/{{ ansible_domain }}.csr csr_path: /etc/ssl/private/{{ collabora_domain }}.csr
provider: selfsigned provider: selfsigned
@@ -1,12 +1,12 @@
<IfModule mod_ssl.c> <IfModule mod_ssl.c>
<VirtualHost *:443> <VirtualHost *:443>
ServerName {{ ansible_domain }} ServerName {{ collabora_domain }}
ServerAdmin {{ admin_mail }} ServerAdmin {{ admin_mail }}
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/{{ ansible_domain }}/fullchain.pem SSLCertificateFile /etc/letsencrypt/live/{{ collabora_domain }}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ ansible_domain }}/privkey.pem SSLCertificateKeyFile /etc/letsencrypt/live/{{ collabora_domain }}/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf Include /etc/letsencrypt/options-ssl-apache.conf
# Encoded slashes need to be allowed # Encoded slashes need to be allowed
@@ -1,5 +1,5 @@
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ ansible_domain }} ServerName {{ collabora_domain }}
ServerAdmin {{ admin_mail }} ServerAdmin {{ admin_mail }}
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
-1
View File
@@ -2,5 +2,4 @@
sshport: 22 sshport: 22
openports_list: openports_list:
- 22 - 22
admin_mail: admin@example.com
#blacklist_ip_list: #blacklist_ip_list: