forked from Uberspace/lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
35 lines (31 loc) · 839 Bytes
/
deploy.yml
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
---
- name: deploy
hosts: all
vars:
docroot: /var/www/virtual/{{ ansible_user }}/{{ lookup('env', 'DOMAIN') }}
tasks:
- name: create document root
file:
path: "{{ docroot }}"
state: directory
- name: copy HTML
synchronize:
src: "build/html/"
dest: "{{ docroot }}/en"
recursive: yes
delete: yes
- name: create .htaccess
copy:
content: |
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{ENV:HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteRule ^$ /en/ [R]
dest: "{{ docroot }}/.htaccess"
- name: Correct Ownership of DocumentRoot
file:
path: "{{ docroot }}"
state: directory
recurse: yes
mode: 0755