-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspring.yaml
More file actions
40 lines (37 loc) · 1.14 KB
/
spring.yaml
File metadata and controls
40 lines (37 loc) · 1.14 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
---
- name: springboot deploy
hosts: ubuntu
become: yes
tasks:
- name: update packages and install java
apt:
name: openjdk-11-jdk -y
update_cache: yes
state: present
- name: create a directory springpetclinic
file:
path: /usr/share/springpetclinic
state: directory
- name: download a file and copy to the directory
get_url:
url: https://referenceapplicationskhaja.s3-us-west-2.amazonaws.com/spring-petclinic-2.4.2.jar
dest: /usr/share/springpetclinic/spring-petclinic-2.4.2.jar
- name: create user springboot
user:
name: springbootuser
password: springbootuser
state: present
- name: change ownership of the jar file
file:
path: /usr/share/springpetclinic/spring-petclinic-2.4.2.jar
owner: springbootuser
mode: '500'
-name: copy the file to node
copy:
dest: /etc/systemd/system/springpetclinic.service
src: springpetclinic.service
-name: enable and start spring pet clinic
systemd:
name: springpetclinic.service
enabled: yes
state: started