I want to deploy a Ninja app to an EC2 Amazon Linux instance using Ansible.
Being a Linux noob and completely new to Ansible, I wonder what the best way would be to start the app via Ansible as a service, rather than just starting a java process, which is what I do for now: java -jar [path to my jar]
.
This works for now, but it's not idempotent. I.e., I don't think Ansible can figure out a way to only to start the app if it's not already running.
I know Ansible has a service module. Would this be the one to use?
Update:
There's a role called fatjar-service on Ansible Galaxy looking like what I need, but it works only for Ubuntu servers. My server has Amazon Linux.