You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
773 B
32 lines
773 B
- name: Install packages for webserver support
|
|
apt:
|
|
name: [
|
|
'nginx',
|
|
'certbot',
|
|
'python3-certbot-nginx',
|
|
]
|
|
state: present
|
|
|
|
- name: Start & enable nginx
|
|
service:
|
|
name: nginx
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: "Install /etc/nginx/sites-enabled/{{ domain_name.store }}"
|
|
template:
|
|
src: "{{ role_path }}/templates/nginx-domain.j2"
|
|
dest: "/etc/nginx/sites-enabled/{{ domain_name.store }}"
|
|
force: no
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify:
|
|
- Restart nginx
|
|
|
|
- name: Setup SSL Certificates
|
|
shell: certbot run --nginx -d {{ domain_name.store }} --agree-tos --register-unsafely-without-email
|
|
args:
|
|
creates: /etc/letsencrypt/live/{{ domain_name.store }}/cert.pem
|
|
notify:
|
|
- Restart nginx
|
|
|