-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev-deploy.yml.deprecated
165 lines (141 loc) · 5.42 KB
/
dev-deploy.yml.deprecated
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
- hosts: default
vars:
mysql_root_password: id3636mysql
tomcat_admin:
user: admin
password: tc3636
mysql_credentials:
user: localidxadm
password: localidxadmpass
lui_version: v0.12
tasks:
- name: Clone lui-solr repo into development tree
connection: local
git: repo=ssh://git.indexdata.com:222/home/git/pub/lui-solr dest=./lui-solr version={{ lui_version }} accept_hostkey=yes
- name: Create deployment environment
become: yes
file: path={{ item }} state=directory
with_items:
- /usr/share/masterkey/lui
- /var/lib/masterkey/lui/solr/lui
- /var/log/masterkey/lui
- /etc/masterkey/lui
- /var/log/masterkey/harvester
- /etc/masterkey/harvester
- name: Install prerequisites from apt
become: yes
apt:
update-cache: yes
name:
- python-apt
- apt-transport-https
- ca-certificates
- openjdk-8-jre-headless
- tomcat9
- tomcat9-admin
- mysql-server
- python3-pymysql
- maven
- name: Create tomcat administrative user
become: yes
lineinfile: dest=/etc/tomcat9/tomcat-users.xml insertbefore="</tomcat-users>" line={{ item }}
with_items:
- ' <role rolename="manager-gui"/>'
- ' <user username="{{ tomcat_admin.user }}" password="{{ tomcat_admin.password }}" roles="manager-gui"/>'
notify: Restart Tomcat
- name: Update permissions on harvester directories
become: yes
file: path={{ item }} owner=tomcat
with_items:
- /var/log/masterkey/harvester
- name: Create systemd directory if not exists
become: yes
file:
path: /etc/systemd/system/tomcat9.service.d
state: directory
- name: Creating logging-allow config
become: yes
copy:
dest: /etc/systemd/system/tomcat9.service.d/logging-allow.conf
content: |
[Service]
ReadWritePaths=/var/log/masterkey
notify: Restart Tomcat
- name: Create lui-solr account
become: yes
user: name=lui-solr state=present system=yes home=/var/lib/masterkey/lui
- name: Update permissions on lui-solr directories
become: yes
file: path={{ item }} owner=lui-solr recurse=yes
with_items:
- /var/lib/masterkey/lui
- /var/log/masterkey/lui
- name: Link Solr configuration
become: yes
file: src=/vagrant/lui-solr/conf/solr path=/etc/masterkey/lui/solr state=link
- name: Link Solr defaults
become: yes
file: src=/etc/masterkey/lui/solr/lui-solr.in.sh path=/etc/default/lui-solr.in.sh state=link
- name: Install Solr binary
become: yes
command: /vagrant/lui-solr/dist/install_solr6_service.sh /vagrant/lui-solr/dist/solr-6.1.0.tgz -d /var/lib/masterkey/lui -i /usr/share/masterkey/lui -s lui-solr -u lui-solr -f creates=/usr/share/masterkey/lui/solr-6.1.0
- name: Remove extra files created by Solr install
become: yes
file: path={{ item }} state=absent
with_items:
- /var/lib/masterkey/lui/log4j.properties
- /var/lib/masterkey/lui/logs
- /var/lib/masterkey/lui/data
- name: Start lui-solr service
become: yes
service: name=lui-solr state=started
- name: Link Harvester web app
become: yes
file: src=/vagrant/harvester/target/harvester path=/usr/share/masterkey/harvester state=link
- name: Link Harvester configuration
become: yes
file: src=/vagrant/harvester/target/harvester/WEB-INF/harvester.properties path=/etc/masterkey/harvester/harvester.properties state=link
- name: Link Harvester stylesheets
become: yes
file: src=/vagrant/harvester/target/harvester/WEB-INF/stylesheets/{{ item }} path=/var/lib/tomcat9/{{ item }} state=link
with_items:
- ARTstor-electronic-url-fix.xsl
- addmergekey.xsl
- addsnippet.xsl
- creator-filter-date-2.0.xsl
- dc-lexis.xsl
- marc21.xsl
- oai2marc.xsl
- oai_dc.xsl
- oaipmh-dc_pazpar2-minimal.xsl
- pz-author-remove-end-date.xsl
- pz-subject-split.xsl
- pz2-ourl-base.xsl
- pz2-ourl-marc21.xsl
- pz2-solr-split-1.0.xsl
- pz2-solr-split-2-levels.xsl
- pz2-solr.xsl
- pz2index.xsl
- snippet2pz.xsl
- solr-subject-split.xsl
- map-relator-to-contributor-type.xsl
- name: Create Harvester cache directory
become: yes
file: path=/var/cache/harvester owner=tomcat group=adm state=directory
- name: Provide access to Harvester test data
become: yes
lineinfile: dest=/etc/tomcat9/server.xml line="\t<Context docBase=\"/vagrant/harvester/test\" path=\"/test\" />" insertbefore="</Host>"
- name: Deploy Tomcat context fragment for Harvester
become: yes
file: src=/vagrant/etc/harvester-context.xml path=/etc/tomcat9/Catalina/localhost/harvester.xml state=link
- name: Link Harvester Admin web app
become: yes
file: src=/vagrant/harvester-admin/target/harvester-admin path=/usr/share/masterkey/harvester-admin state=link
- name: Deploy Tomcat context fragment for Harvester Admin
become: yes
file: src=/vagrant/etc/harvester-admin-context.xml path=/etc/tomcat9/Catalina/localhost/harvester-admin.xml state=link
handlers:
- name: Restart Tomcat
become: yes
service: name=tomcat9 state=restarted