-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
116 lines (99 loc) · 3.57 KB
/
main.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
- name: install genisoimage
apt: name=genisoimage
# we need xmllint to format the ncc.html and the master.smil
- name: install xmllint
apt: name=libxml2-utils
- name: create spool directory for outgoing files to ABACUS
file: path=/var/spool/abacus state=directory
# - name: mount all needed directories from the main file server and from the studio server
# mount: name={{ item.name }} src={{ item.src }} fstype=nfs state=mounted
# with_items:
# - { name: '/mnt/a03/agadir', src: 'a03:/disk/sdb1/agadir/in'}
# - { name: '/mnt/a03/encoded', src: 'a03:/disk/sdb1/madras2/encoded'}
# - { name: '/mnt/a03/iso', src: 'a03:/disk/sdb1/madras2/iso'}
# - { name: '/mnt/a03/split', src: 'a03:/disk/sdb1/madras2/split'}
# - { name: '/mnt/miloun/structured', src: 'miloun:/mnt/studio/studio/madras2/structured'}
# - { name: '/mnt/miloun/recorded', src: 'miloun:/mnt/studio/studio/madras2/recorded'}
# - { name: '/mnt/miloun/recording', src: 'miloun:/mnt/studio/studio/madras2/recording'}
# FIXME: this fails because root apparently cannot mount this
# - name: mount the archive for other productions
# mount: name={{ item.name }} src={{ item.src }} fstype=nfs state=mounted
# with_items:
# - { name: '/mnt/a03/d14', src: 'a03:/mnt/archive/d14'}
# - { name: '/mnt/a03/kleinauftraege', src: 'a03:/mnt/archive/kleinauftraege'}
- name: create symlinks to the mounts so that the dirs are where madras2 expects them
file: path={{ item.path }} src={{ item.src }} state=link
with_items:
- { path: '/var/spool/agadir/books', src: '/mnt/a03/agadir' }
- { path: '/var/spool/agadir/periodicals', src: '/mnt/a03/d14' }
- { path: '/var/spool/agadir/other', src: '/mnt/a03/kleinauftraege' }
- { path: '/var/lib/mdr2/structured', src: '/mnt/vac/structured' }
- { path: '/var/lib/mdr2/recorded', src: '/mnt/vac/recorded' }
- { path: '/var/lib/mdr2/recording', src: '/mnt/vac/recording' }
- { path: '/var/lib/mdr2/encoded', src: '/mnt/a03/encoded' }
- { path: '/var/lib/mdr2/iso', src: '/mnt/a03/iso' }
- { path: '/var/lib/mdr2/split', src: '/mnt/a03/split' }
- name: create an install directory
file:
path: "{{ madras2_install_dir }}"
state: directory
- name: Download the jar file
get_url:
url: https://github.com/sbsdev/mdr2/releases/download/{{ madras2_version }}/mdr2.jar
dest: "{{ madras2_install_dir }}/mdr2.jar"
notify:
- restart madras2
- name: create a config directory
file:
path: /etc/madras2
state: directory
- name: create a config file
template:
src: config.edn.j2
dest: /etc/madras2/config.edn
mode: '0600'
notify:
- restart madras2
- name: create the logback config file
template:
src: logback.xml.j2
dest: /etc/madras2/logback.xml
mode: '0600'
notify:
- restart madras2
- name: create an init script
template:
src: madras2.service.j2
dest: /etc/systemd/system/madras2.service
mode: '0644'
notify:
- restart madras2
- name: enable the service
service:
name: madras2
enabled: yes
notify:
- restart madras2
- name: create an sites available file for nginx
template:
src: sites-available.j2
dest: /etc/nginx/sites-available/madras2
mode: '0644'
notify:
- restart nginx
- name: create a link in sites enabled for nginx
file:
src: /etc/nginx/sites-available/madras2
dest: /etc/nginx/sites-enabled/madras2
owner: root
group: root
state: link
notify:
- restart nginx
- name: remove the default site from nginx
file:
path: /etc/nginx/sites-enabled/default
state: absent
notify:
- restart nginx