Use copr_frontend_public_hostname instead of inventory_hostname

Because inventory_hostname is set to copr-fe.cloud.fedoraproject.org
on frontend production instance. However, we want a variable that
is evaluated to copr.fedorainfracloud.org
This commit is contained in:
Jakub Kadlčík 2018-08-20 18:53:47 +02:00 committed by clime
parent e78f97bfbb
commit c892543dc3
2 changed files with 10 additions and 10 deletions

View file

@ -109,7 +109,7 @@
- name: Check that cert file exists
stat:
path: "/etc/letsencrypt/live/{{ inventory_hostname }}/cert.pem"
path: "/etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/cert.pem"
register: stat_cert
- name: Should admin run certbot?

View file

@ -14,12 +14,12 @@ Listen 443 https
SSLCertificateKeyFile /etc/pki/tls/private/copr.fedorainfracloud.org.key
SSLCertificateChainFile /etc/pki/tls/certs/copr.fedorainfracloud.org.intermediate.crt
{% else %}
SSLCertificateFile /etc/letsencrypt/live/{{ inventory_hostname }}/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ inventory_hostname }}/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem
SSLCertificateFile /etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/fullchain.pem
{% endif %}
ServerName {{ inventory_hostname }}
ServerName {{ copr_frontend_public_hostname }}
WSGIPassAuthorization On
WSGIScriptAlias / /usr/share/copr/coprs_frontend/application
@ -68,14 +68,14 @@ Listen 443 https
SSLCertificateKeyFile /etc/pki/tls/private/copr.fedorainfracloud.org.key
SSLCertificateChainFile /etc/pki/tls/certs/copr.fedorainfracloud.org.intermediate.crt
{% else %}
SSLCertificateFile /etc/letsencrypt/live/{{ inventory_hostname }}/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ inventory_hostname }}/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem
SSLCertificateFile /etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/fullchain.pem
{% endif %}
ServerAlias {{ inventory_hostname }}
ServerAlias {{ copr_frontend_public_hostname }}
Redirect 302 / https://{{ inventory_hostname }}/
Redirect 302 / https://{{ copr_frontend_public_hostname }}/
</VirtualHost>