Adds basic ansible deployment

This commit is contained in:
Sebastian Sdorra 2017-09-26 17:30:07 +02:00
parent 63d5dd3299
commit f24fb87c1e
4 changed files with 55 additions and 2 deletions

7
.gitignore vendored
View file

@ -6,3 +6,10 @@ target/*
*.iml
/target
_site/
# Created by https://www.gitignore.io/api/ansible
### Ansible ###
*.retry
# End of https://www.gitignore.io/api/ansible

34
playbook.yaml Normal file
View file

@ -0,0 +1,34 @@
---
- hosts: all
become: yes
gather_facts: yes
tasks:
- name: Copy systemd descriptor
copy:
src: src/main/systemd/spring-petclinic.service
dest: /etc/systemd/system/spring-petclinic.service
notify:
- reload systemd
- name: Copy spring-petclinic
copy:
src: target/spring-petclinic-1.5.1.jar
dest: /opt/spring-petclinic.jar
owner: deploy
mode: u+rwx
notify:
- restart service
handlers:
- name: reload systemd
systemd:
name: spring-petclinic
daemon_reload: yes
- name: restart service
service:
name: spring-petclinic
state: restarted

View file

@ -130,6 +130,7 @@
<goal>build-info</goal>
</goals>
<configuration>
<executable>true</executable>
<additionalProperties>
<encoding.source>${project.build.sourceEncoding}</encoding.source>
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>

View file

@ -0,0 +1,11 @@
[Unit]
Description=spring-petclinic
After=syslog.target
[Service]
User=deploy
ExecStart=/opt/spring-petclinic.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target