blob: ea821d8ba66022e528132250147616ea3d2aecf4 (
plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
- name: Copy first stage nginx config
copy:
src: nginx_nossl.conf
dest: /etc/nginx/nginx.conf
- name: Add nginx user to uwsgi group for access to uwsgi socket
user:
name: nginx
groups: uwsgi
append: yes
- name: Create blog.jaseg.net content dir
file:
path: /var/www/blog.jaseg.net
state: directory
owner: nginx
group: nginx
mode: 0550
- name: Copy uwsgi systemd socket config
copy:
src: uwsgi-app@.socket
dest: /etc/systemd/system/
- name: Copy uwsgi systemd service config
copy:
src: uwsgi-app@.service
dest: /etc/systemd/system/
- name: Set SELinux to permissive mode # FIXME this is to let nginx talk to uwsgi
selinux:
state: permissive
policy: targeted
- name: Enable and launch nginx systemd service
systemd:
name: nginx.service
enabled: yes
state: restarted
- name: Create letsencrypt certificate for gerbolyze.jaseg.net
command: certbot --nginx certonly -d gerbolyze.jaseg.net -n --agree-tos --email gerboweb@jaseg.net
args:
creates: /etc/letsencrypt/live/gerbolyze.jaseg.net/fullchain.pem
- name: Create letsencrypt certificate for blog.jaseg.net
command: certbot --nginx certonly -d blog.jaseg.net -n --agree-tos --email blog@jaseg.net
args:
creates: /etc/letsencrypt/live/blog.jaseg.net/fullchain.pem
- name: Copy final nginx config
copy:
src: nginx.conf
dest: /etc/nginx/nginx.conf
- name: Restart nginx to load new cert
systemd:
name: nginx.service
state: restarted
- name: Enable certbot renewal timer
systemd:
name: certbot-renew.timer
enabled: yes
|