rename web
This commit is contained in:
19
web/roles/nginx/tasks/certbot.yml
Normal file
19
web/roles/nginx/tasks/certbot.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
- name: Install certbot package
|
||||
apt:
|
||||
name: ['certbot', 'python3-certbot-nginx']
|
||||
state: present
|
||||
|
||||
- name: Get certs using certbot
|
||||
shell: certbot run --test-cert --register-unsafely-without-email --agree-tos -n -d {{item}}{{domain}} --nginx
|
||||
loop:
|
||||
- cloud.
|
||||
- wiki.
|
||||
- pma.
|
||||
-
|
||||
|
||||
- name: restart nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
32
web/roles/nginx/tasks/configure.yml
Normal file
32
web/roles/nginx/tasks/configure.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
|
||||
- name: install nginx config
|
||||
template:
|
||||
src: files/nginx.conf
|
||||
dest: /etc/nginx/nginx.conf
|
||||
owner: www-data
|
||||
|
||||
- name: remove default config
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/default
|
||||
state: absent
|
||||
owner: www-data
|
||||
|
||||
- name: install site's configs
|
||||
template:
|
||||
src: files/sites-enabled/{{ item }}
|
||||
dest: /etc/nginx/sites-enabled/{{ item }}
|
||||
owner: www-data
|
||||
loop: ['wiki.conf', 'root.conf', 'pma.conf', 'default_server.conf', 'cloud.conf']
|
||||
|
||||
- name: create dirs
|
||||
file:
|
||||
path: /var/www/{{item}}
|
||||
state: directory
|
||||
owner: www-data
|
||||
loop: ['pma','cloud','wiki','default','root']
|
||||
|
||||
- name: reload nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
12
web/roles/nginx/tasks/main.yml
Normal file
12
web/roles/nginx/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Install nginx package
|
||||
apt:
|
||||
name: nginx
|
||||
state: present
|
||||
|
||||
- name: configure nginx
|
||||
include_tasks: configure.yml
|
||||
|
||||
- name: install ssl
|
||||
include_tasks: certbot.yml
|
||||
when: ssl
|
||||
Reference in New Issue
Block a user