2017-07-03 21:18:45 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Ensure certificates are available
|
2020-06-20 22:12:05 +02:00
|
|
|
command:
|
|
|
|
cmd: >
|
|
|
|
openssl req -x509 -nodes -newkey rsa:2048
|
|
|
|
-keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key
|
|
|
|
-out /etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
|
|
|
-days 730 -subj "/CN={{ ansible_fqdn }}"
|
|
|
|
creates: /etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
2017-07-03 21:18:45 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
2017-11-16 19:02:26 +01:00
|
|
|
- name: Create web content directory
|
2018-01-15 20:19:24 +01:00
|
|
|
file: path=/var/www/html state=directory mode=0755
|
2017-11-16 19:02:26 +01:00
|
|
|
|
2017-07-03 21:18:45 +02:00
|
|
|
- name: Configure certificate manager
|
2020-06-16 22:46:46 +02:00
|
|
|
template: src=certs.j2 dest=/etc/acertmgr/{{ ansible_fqdn }}.conf
|
2019-03-07 15:09:08 +01:00
|
|
|
notify: Run acertmgr
|
2017-07-03 21:18:45 +02:00
|
|
|
|
|
|
|
- name: Configure vhosts
|
|
|
|
template: src=vhost.j2 dest=/etc/nginx/sites-available/www
|
|
|
|
notify: Restart nginx
|
|
|
|
|
|
|
|
- name: Enable vhosts
|
|
|
|
file: src=/etc/nginx/sites-available/www dest=/etc/nginx/sites-enabled/www state=link
|
|
|
|
notify: Restart nginx
|