-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
74 lines (64 loc) · 1.72 KB
/
site.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- hosts: jbp
remote_user: root
tasks:
- name: Install required packages
apt:
name: "{{ item }}"
state: present
with_items:
- git
- php
- name: Download
get_url:
url: https://gitlab.com/mojo42/Jirafeau/-/archive/4.1.1/Jirafeau-4.1.1.tar.gz
dest: /tmp/
- name: Make project folder
file:
path: /var/www/jiraf
state: directory
- name: Make project folder
file:
path: /var/www/jiraf/data
state: directory
- name: Make project folder
file:
path: /var/www/jiraf/data/{{ item }}
state: directory
with_items:
- files
- links
- async
- name: Unarchive project
unarchive:
src: /tmp/Jirafeau-4.1.1.tar.gz
dest: /var/www/jiraf/
extra_opts: [--strip-components=1]
remote_src: yes
- name: Upload config file
template:
src: config.j2
dest: /var/www/jiraf/lib/config.local.php
- name: Upload Apache config
template:
src: apache_config.j2
dest: /etc/apache2/sites-available/{{ domain_name }}.conf
register: config
- name: Change ownership
file:
path: /var/www/jiraf
recurse: yes
owner: www-data
group: www-data
- name: Create symlink of {{ domain_name }}.conf
file:
src: /etc/apache2/sites-available/{{ domain_name }}.conf
dest: /etc/apache2/sites-enabled/{{ domain_name }}.conf
state: link
force: yes
register: slink
- name: Reload apache
systemd:
name: apache2.service
state: reloaded
when: config.changed or slink.changed