Skip to content

Instantly share code, notes, and snippets.

@jonashackt
Last active October 15, 2022 14:42
Show Gist options
  • Save jonashackt/9428fbf9dd82c18c123f4f2cbb3e0246 to your computer and use it in GitHub Desktop.
Save jonashackt/9428fbf9dd82c18c123f4f2cbb3e0246 to your computer and use it in GitHub Desktop.
Start SpringBoot .jar via ansible on Windows box
---
- 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