0

I wanted to create a ansible playbook for Windows Host to Install a service and set the service options using NSSM in windows and for that I tried exploring win_nssm module to find any suitable option through which I can set below service options of NSSM :-

AppNoConsole 0
AppPriority NORMAL_PRIORITY_CLASS
AppStopMethodSkip 0

I also want to add service options of NSSM Process Tab, ShutDown Tab and others.

For Reference :-

I can do it manually by using below commands to set service options to my service myapp :-

nssm set myapp AppNoConsole 0
nssm set myapp AppPriority NORMAL_PRIORITY_CLASS
nssm set myapp AppStopMethodSkip 0

Note: myapp is my service name

My Current ansible_playbook.yml file

---

- name: Windows Service Installation
  host: localhost
  tasks:

    - name: Install the Processingnode service
      win_nssm:
        name: myapp
        application: "C:/myapp.exe"
        display_name: "myapp"
        stderr_file: 'C:\Program Files\myapp\service_out.log'
        stdout_file: 'C:\Program Files\myapp\service_out.log'
        working_directory: "C:\Program Files\myapp"
      tags: install

    - name: Configure and start the myapp service
      win_service:
        name: myapp
        start_mode: auto
        state: started
      tags: install

I couldn't able to find any option in win_nssm module. Is there any other way through which I can set above service options to a service using ansible ?

Kush
  • 1

0 Answers0