-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.yml
More file actions
45 lines (39 loc) · 1.12 KB
/
deploy.yml
File metadata and controls
45 lines (39 loc) · 1.12 KB
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
- hosts: all
vars:
TOMCAT_VERSION: 8.5.3
TOMCAT_MAJOR: 8
ROOT_DIR: "/var/lib"
TOMCAT_HOME: "{{ ROOT_DIR }}/tomcat"
CATALINA_HOME: "{{ TOMCAT_HOME }}"
tasks:
- name: install openjdk
apk:
name: openjdk8
state: present
update_cache: yes
- name: install curl
package:
name: tar
state: present
- name: create tomcat dir
file:
path: "{{ ROOT_DIR }}"
state: directory
- name: get tomcat
unarchive:
src: "http://archive.apache.org/dist/tomcat/tomcat-{{TOMCAT_MAJOR}}/v{{TOMCAT_VERSION}}/bin/apache-tomcat-{{TOMCAT_VERSION}}.tar.gz"
dest: "{{ TOMCAT_HOME | dirname }}"
remote_src: yes
- name: link tomcat
file:
src: "{{ ROOT_DIR }}/apache-tomcat-{{ TOMCAT_VERSION }}"
dest: "{{ TOMCAT_HOME }}"
state: link
- name: start catalina
environment:
PATH: "/usr/bin:/bin:/sbin"
shell: "{{ TOMCAT_HOME }}/bin/catalina.sh start"
- name: copy war
copy:
src: "../target/spring-base-1.0.war"
dest: "{{ TOMCAT_HOME }}/webapps"