add certbot, nginx-host tasks

This commit is contained in:
2023-09-10 22:58:50 +02:00
parent 36a3f30c3d
commit d5c1dfe04c
10 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
---
- name: Ensure virtual host variables are defined
ansible.builtin.assert:
that:
- server_name is defined
- server_root is defined
- name: Configure virtual host
ansible.builtin.template:
src: virtual-host.j2
dest: /etc/nginx/sites-available/{{ server_name }}
owner: root
group: root
- name: Symlink the virtual host
ansible.builtin.file:
src: /etc/nginx/sites-available/{{ server_name }}
dest: /etc/nginx/sites-enabled/{{ server_name }}
owner: root
group: root
state: link
- name: Create the document root
ansible.builtin.file:
path: '{{ server_root }}'
state: directory
mode: '0755'
owner: www-data
group: www-data
#- name: Enable HTTPS