mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 09:55:49 +00:00
Create spc1.yaml
This commit is contained in:
parent
bf6cf2bf60
commit
b1c47b86be
1 changed files with 32 additions and 0 deletions
32
spc1.yaml
Normal file
32
spc1.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
- name: spc deployment
|
||||
hosts: localhost
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install java
|
||||
ansible.builtin.apt:
|
||||
name: openjdk-17-jdk
|
||||
state: present
|
||||
update_cache: true
|
||||
- name: edit the service file
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/systemd/system/spc.service
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Manage Java service
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/home/ubuntu/spc/target
|
||||
ExecStart=java -jar spring-petclinic-3.0.0-SNAPSHOT.jar
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
mode: '777'
|
||||
- name: reload the systemd state
|
||||
ansible.builtin.systemd:
|
||||
name: spc.service
|
||||
daemon_reload: true
|
||||
enabled: true
|
||||
state: "restarted"
|
Loading…
Reference in a new issue