rename web

This commit is contained in:
2021-06-30 02:30:24 +00:00
parent 7c78252bfe
commit ceba4626c8
21 changed files with 7 additions and 1 deletions

View 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

View 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

View 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