switched to new facts-syntax
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
---
|
||||
# Load distro specific variables
|
||||
- include_vars: "{{ ansible_distribution | lower }}.yml"
|
||||
- include_vars: "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||
tags: always
|
||||
- include_vars: "{{ ansible_fqdn | lower }}.yml"
|
||||
- include_vars: "{{ ansible_facts['fqdn'] | lower }}.yml"
|
||||
ignore_errors: True
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- stat: path=/etc/letsencrypt/live/{{ mastodon_host | default(ansible_fqdn) }}/fullchain.pem
|
||||
- stat: path=/etc/letsencrypt/live/{{ mastodon_host | default(ansible_facts['fqdn']) }}/fullchain.pem
|
||||
register: letsencrypt_cert
|
||||
|
||||
- name: Copy letsencrypt nginx config
|
||||
@@ -19,7 +19,7 @@
|
||||
- migration is not defined or migration == False
|
||||
|
||||
- name: Install letsencrypt cert
|
||||
command: certbot certonly -n --webroot -d {{ mastodon_host | default(ansible_fqdn) }} -w {{ mastodon_home }}/{{ mastodon_path }}/public/ --email "webmaster@{{ mastodon_host | default(ansible_fqdn) }}" --agree-tos && systemctl reload nginx
|
||||
command: certbot certonly -n --webroot -d {{ mastodon_host | default(ansible_facts['fqdn']) }} -w {{ mastodon_home }}/{{ mastodon_path }}/public/ --email "webmaster@{{ mastodon_host | default(ansible_facts['fqdn']) }}" --agree-tos && systemctl reload nginx
|
||||
when:
|
||||
- not letsencrypt_cert.stat.exists
|
||||
- migration == False or migration is not defined
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- debug:
|
||||
msg: "Hostname: {{ mastodon_host | default(ansible_fqdn) }}"
|
||||
msg: "Hostname: {{ mastodon_host | default(ansible_facts['fqdn']) }}"
|
||||
|
||||
- name: mastodon | Copy nginx config
|
||||
template:
|
||||
|
||||
@@ -6,7 +6,7 @@ map $http_upgrade $connection_upgrade {
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name {{ mastodon_host | default(ansible_fqdn) }};
|
||||
server_name {{ mastodon_host | default(ansible_facts['fqdn']) }};
|
||||
|
||||
# Useful for Let's Encrypt
|
||||
location /.well-known/acme-challenge/ { allow all; }
|
||||
@@ -16,7 +16,7 @@ server {
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name {{ mastodon_host | default(ansible_fqdn) }};
|
||||
server_name {{ mastodon_host | default(ansible_facts['fqdn']) }};
|
||||
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
|
||||
@@ -24,8 +24,8 @@ server {
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
{% if disable_letsencrypt != "true" %}
|
||||
ssl_certificate /etc/letsencrypt/live/{{ mastodon_host | default(ansible_fqdn) }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ mastodon_host | default(ansible_fqdn) }}/privkey.pem;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ mastodon_host | default(ansible_facts['fqdn']) }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ mastodon_host | default(ansible_facts['fqdn']) }}/privkey.pem;
|
||||
{% endif %}
|
||||
|
||||
keepalive_timeout 70;
|
||||
|
||||
Reference in New Issue
Block a user