Move letsencrypt tasks to separate file
This commit is contained in:
parent
c30d0795f8
commit
2a3a7c65ce
2 changed files with 31 additions and 26 deletions
29
roles/copr/frontend-cloud/tasks/letsencrypt.yml
Normal file
29
roles/copr/frontend-cloud/tasks/letsencrypt.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
- name: letsencrypt cert
|
||||||
|
include_role: name=certbot
|
||||||
|
when: devel
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
|
||||||
|
- name: Check that cert file exists
|
||||||
|
stat:
|
||||||
|
path: "/etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/cert.pem"
|
||||||
|
register: stat_cert
|
||||||
|
|
||||||
|
- name: Should admin run certbot?
|
||||||
|
fail:
|
||||||
|
msg: Please see roles/certbot/README step (2) and manually run certbot
|
||||||
|
when:
|
||||||
|
- stat_cert.stat.exists == False
|
||||||
|
- devel
|
||||||
|
|
||||||
|
- name: install copr-frontend ssl vhost
|
||||||
|
template: src="httpd/coprs_ssl.conf.j2" dest="/etc/httpd/conf.d/coprs_ssl.conf"
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
|
||||||
|
- name: Set SELinux context for certs generation
|
||||||
|
sefcontext:
|
||||||
|
target: "/srv/web/acme-challenge/.well-known"
|
||||||
|
setype: httpd_sys_content_t
|
||||||
|
state: present
|
||||||
|
when: devel
|
|
@ -104,36 +104,12 @@
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
- name: letsencrypt cert
|
- name: install letsencrypt ssl certificates for dev
|
||||||
include_role: name=certbot
|
import_tasks: "letsencrypt.yml"
|
||||||
when: devel
|
when: devel
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
- name: Check that cert file exists
|
|
||||||
stat:
|
|
||||||
path: "/etc/letsencrypt/live/{{ copr_frontend_public_hostname }}/cert.pem"
|
|
||||||
register: stat_cert
|
|
||||||
|
|
||||||
- name: Should admin run certbot?
|
|
||||||
fail:
|
|
||||||
msg: Please see roles/certbot/README step (2) and manually run certbot
|
|
||||||
when:
|
|
||||||
- stat_cert.stat.exists == False
|
|
||||||
- devel
|
|
||||||
|
|
||||||
- name: install copr-frontend ssl vhost
|
|
||||||
template: src="httpd/coprs_ssl.conf.j2" dest="/etc/httpd/conf.d/coprs_ssl.conf"
|
|
||||||
tags:
|
|
||||||
- config
|
|
||||||
|
|
||||||
- name: Set SELinux context for certs generation
|
|
||||||
sefcontext:
|
|
||||||
target: "/srv/web/acme-challenge/.well-known"
|
|
||||||
setype: httpd_sys_content_t
|
|
||||||
state: present
|
|
||||||
when: devel
|
|
||||||
|
|
||||||
- name: enable services
|
- name: enable services
|
||||||
service: state=started enabled=yes name={{ item }}
|
service: state=started enabled=yes name={{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue