Last active
October 15, 2022 14:42
-
-
Save jonashackt/9428fbf9dd82c18c123f4f2cbb3e0246 to your computer and use it in GitHub Desktop.
Start SpringBoot .jar via ansible on Windows box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: "{{host}}" | |
tasks: | |
- name: Create directory C:\yourPath | |
win_file: path="C:\\yourPath" state=directory | |
- name: Install nssm (non-sucking service manager) with chocolatey | |
win_chocolatey: name=nssm | |
- name: Copy jar-File into directory C:\yourPath on your Windows Box | |
win_copy: src={{yourSourceJarNameHere}} dest=C:\\yourPath\\{{yourJarNameHere}}.jar | |
- name: starting yourJarNameHere.jar as nssm service | |
win_nssm: | |
name: "{{yourJarNameHere}}" | |
application: "java.exe" | |
app_parameters: | |
"-jar": C:\\yourPath\\{{yourJarNameHere}}.jar | |
state: restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment