This commit is contained in:
Julien Palard 2019-12-13 17:27:42 +01:00
commit 96bc8c2952
8 changed files with 62 additions and 0 deletions

3
Makefile Normal file
View File

@ -0,0 +1,3 @@
all:
ansible-galaxy install -f julienpalard.nginx_letsencrypt
ansible-playbook playbook-mdk.yml -i inventory.yml

10
inventory.yml Normal file
View File

@ -0,0 +1,10 @@
all:
vars:
ansible_user: root
ansible_python_interpreter: /usr/bin/python3
children:
mdk:
hosts:
mdk.fr:
ansible_host: 51.15.187.166
online_server: sd-131717

7
playbook-mdk.yml Normal file
View File

@ -0,0 +1,7 @@
- hosts: mdk
roles:
- role: static_website
uri: mdk.fr
owner: mdk
path: /var/www/mdk.fr/
letsencrypt_email: julien@palard.fr

View File

@ -0,0 +1,3 @@
---
nginx_extra: ""

View File

@ -0,0 +1,4 @@
---
- name: reload nginx
service: name=nginx state=reloaded

View File

@ -0,0 +1,4 @@
---
dependencies:
- role: julienpalard.nginx_letsencrypt
domains: ["{{ uri }}"]

View File

@ -0,0 +1,15 @@
---
- name: Configure pelican
template:
src: pelican.conf
dest: /etc/nginx/conf.d/pelican-{{ uri }}.conf
notify: reload nginx
- name: WWW directory
file:
path: "{{ path }}"
state: directory
owner: "{{ owner }}"
group: "{{ owner }}"
mode: 0755

View File

@ -0,0 +1,16 @@
server
{
listen 80;
server_name .{{ uri }};
return 301 https://$host$request_uri;
}
server
{
listen 443 ssl;
server_name .{{ uri }};
root /var/www/{{ uri }}/;
include snippets/letsencrypt-{{ uri }}.conf;
index index.html;
{{ nginx_extra }}
}