-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
main.yml
34 lines (28 loc) · 774 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- hosts: letsencrypt
become: true
vars_files:
- vars/main.yml
pre_tasks:
- name: Ensure apt cache is updated.
apt: update_cache=true cache_valid_time=600
roles:
- geerlingguy.firewall
- geerlingguy.nginx
- geerlingguy.certbot
tasks:
- name: Ensure docroot exists.
file:
path: "{{ nginx_docroot }}"
state: directory
- name: Copy example index.html file in place.
copy:
src: files/index.html
dest: "{{ nginx_docroot }}/index.html"
mode: 0755
- name: Copy Nginx server configuration in place.
template:
src: templates/https-letsencrypt.conf.j2
dest: /etc/nginx/sites-enabled/https-letsencrypt.conf
mode: 0644
notify: restart nginx