-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathmain.yml
170 lines (155 loc) · 4.6 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
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
166
167
168
169
170
- include_tasks: ../../common/tasks/setfacts.yml
- include_tasks: ../../apache_vhost/tasks/main.yml
vars:
context_path: '{{ spatial_service_context_path }}'
hostname: '{{ spatial_service_hostname }}'
tags:
- deploy
- apache_vhost
- spatial-service
when: not webserver_nginx
- name: add nginx vhost if configured
include_role:
name: nginx_vhost
vars:
appname: "spatial-service"
hostname: "{{ spatial_service_hostname }}"
context_path: "{{ spatial_service_context_path }}"
allow_x_frame: "SAMEORIGIN"
tags:
- nginx_vhost
- deploy
- spatial-service
when: webserver_nginx
- name: Add proxy paths for grandfathered routes
include_role:
name: nginx_vhost
vars:
appname: "spatial-service"
hostname: "{{ spatial_service_hostname }}"
context_path: "{{ spatial_service_context_path }}"
nginx_paths:
- path: "{{ spatial_hub_context_path }}files"
is_proxy: false
alias: "{{ data_dir }}/ala/runtime/files/"
- path: "/alaspatial"
is_proxy: true
proxy_pass: "http://127.0.0.1:8080{{spatial_service_context_path}}"
- path: "/layers-service"
is_proxy: true
proxy_pass: "http://127.0.0.1:8080{{spatial_service_context_path}}"
- path: "/layers"
is_proxy: false
rewrite: "{{spatial_service_context_path}}/layers/index"
- path: "/layers/more"
is_proxy: true
proxy_pass: "http://127.0.0.1:8080{{spatial_service_context_path}}/layers/view/more"
tags:
- nginx_vhost
- deploy
- spatial-service
when: webserver_nginx
- include_tasks: ../../tomcat_deploy/tasks/main.yml
vars:
war_url: '{{ spatial_service_war_url }}'
context_path: '{{ spatial_service_context_path }}'
hostname: '{{ spatial_service_hostname }}'
tags:
- deploy
- tomcat_vhost
- spatial-service
- spatial-service-deploy
- name: ensure target directories exist [data subdirectories etc.]
file: path={{item}} state=directory owner={{tomcat_user}} group={{tomcat_user}}
with_items:
- "{{data_dir}}/spatial-service/config"
- "{{data_dir}}/ala/data/runtime/files"
- "{{data_dir}}/spatial-data"
- "{{data_dir}}/spatial-data/uploads"
- "{{data_dir}}/spatial-data/public"
- "{{data_dir}}/spatial-data/private"
tags:
- spatial-service
- spatial-service-config
- properties
- name: copy all config.yml
template: src=spatial-service-config.yml dest={{data_dir}}/spatial-service/config/spatial-service-config.yml
tags:
- config
- spatial-service
- spatial-service-config
- properties
- properties-file
- name: set data ownership
file: path={{data_dir}}/ala/data/ owner={{tomcat_user}} group={{tomcat_user}} recurse=true
notify:
- restart tomcat
tags:
- config
- spatial-service
- spatial-service-config
- properties
- name: Create directory for aloc.jar
file: path={{data_dir}}/spatial-data/modelling/aloc owner={{tomcat_user}} group={{tomcat_user}} recurse=true state=directory mode='0755'
tags:
- spatial-service
- spatial-deps
- name: "Download aloc.jar"
maven_artifact:
group_id: au.org.ala.spatial
artifact_id: ala-aloc
version: "{{ ala_aloc_version | default(1.0) }}"
extension: jar
classifier: "distribution"
repository_url: "{{maven_repo_url}}"
timeout: 30
dest: "{{data_dir}}/spatial-data/modelling/aloc/aloc.jar"
mode: u=rwx,g=rx,o=rx
owner: "{{ tomcat_user }}"
group: "{{ tomcat_user }}"
verify_checksum: always
tags:
- spatial-service
- spatial-deps
- name: Download maxent.zip
get_url:
url: 'https://biodiversityinformatics.amnh.org/open_source/maxent/maxent.php?op=download'
dest: /tmp/maxent.zip
tags:
- spatial-service
- spatial-deps
- name: Create directory for maxent
file: path={{data_dir}}/spatial-data/modelling/maxent owner={{tomcat_user}} group={{tomcat_user}} recurse=true state=directory mode='0755'
tags:
- spatial-service
- spatial-deps
- name: Extract maxent.zip
unarchive:
src: /tmp/maxent.zip
dest: /tmp/
remote_src: true
tags:
- spatial-service
- spatial-deps
- name: Copy maxent.jar to the destination directory
copy:
src: /tmp/maxent/maxent.jar
dest: "{{data_dir}}/spatial-data/modelling/maxent/maxent.jar"
remote_src: true
tags:
- spatial-service
- spatial-deps
- name: Remove temporary maxent.zip file
file:
path: /tmp/maxent.zip
state: absent
tags:
- spatial-service
- spatial-deps
- name: Remove extracted maxent directory
file:
path: /tmp/maxent
state: absent
tags:
- spatial-service
- spatial-deps