2018-08-26 17:15:01 +02:00
|
|
|
---
|
|
|
|
- name: install NSSM
|
|
|
|
win_chocolatey:
|
|
|
|
name: NSSM
|
|
|
|
state: present
|
|
|
|
|
2018-08-27 01:36:47 +02:00
|
|
|
- name: ensure testing folder exists
|
|
|
|
win_file:
|
|
|
|
path: '{{test_win_nssm_path}}'
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: create test user for service execution
|
|
|
|
win_user:
|
|
|
|
name: '{{test_win_nssm_username}}'
|
|
|
|
password: '{{test_win_nssm_password}}'
|
|
|
|
state: present
|
|
|
|
groups:
|
|
|
|
- Users
|
|
|
|
|
2018-08-26 17:15:01 +02:00
|
|
|
# Run actual tests
|
|
|
|
- block:
|
|
|
|
- include_tasks: tests.yml
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: ensure test service is absent
|
|
|
|
win_service:
|
|
|
|
name: '{{ test_service_name }}'
|
|
|
|
state: absent
|
|
|
|
|
2018-08-27 01:36:47 +02:00
|
|
|
- name: remove test user
|
|
|
|
win_user:
|
|
|
|
name: '{{test_win_nssm_username}}'
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: cleanup test folder
|
|
|
|
win_file:
|
|
|
|
path: '{{test_win_nssm_path}}'
|
|
|
|
state: absent
|
|
|
|
|
2018-08-26 17:15:01 +02:00
|
|
|
- name: uninstall NSSM
|
|
|
|
win_chocolatey:
|
|
|
|
name: NSSM
|
|
|
|
state: absent
|
|
|
|
failed_when: false
|