ansible/roles/web_svc/tasks/websvc.yml
Markus Hauschild dc6f2e1e5b
All checks were successful
continuous-integration/drone/push Build is passing
web-svc: rename to web_svc
2020-10-06 10:17:06 +02:00

24 lines
744 B
YAML

---
- name: Ensure certificates are available
command:
cmd: >
openssl req -x509 -nodes -newkey rsa:2048
-keyout /etc/nginx/ssl/{{ domain }}.key
-out /etc/nginx/ssl/{{ domain }}.crt
-days 730 -subj "/CN={{ domain }}"
creates: /etc/nginx/ssl/{{ domain }}.crt
notify: Restart nginx
- name: Configure certificate manager
template: src={{ web_svc }}_certs.j2 dest=/etc/acertmgr/{{ domain }}.conf
notify: Run acertmgr
- name: Configure vhosts
template: src={{ web_svc }}_vhost.j2 dest=/etc/nginx/sites-available/{{ web_svc }}
notify: Restart nginx
- name: Enable vhosts
file: src=/etc/nginx/sites-available/{{ web_svc }} dest=/etc/nginx/sites-enabled/{{ web_svc }} state=link
notify: Restart nginx