ansible/roles/web_gw/tasks/main.yml

27 lines
807 B
YAML
Raw Normal View History

2017-07-03 21:18:45 +02:00
---
- name: Ensure certificates are available
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
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
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