win_nssm: restore comma as separator for service dependencies

Revert commit ddd4b4b

(cherry picked from commit ead882bb9b0bb9e576eda9e074f9150785f9512f)
This commit is contained in:
Kévin Subileau 2018-08-29 13:38:52 +02:00 committed by Toshio Kuratomi
parent 4215feeb5e
commit 2de895a07b
3 changed files with 8 additions and 8 deletions

View file

@ -27,7 +27,7 @@ $startMode = Get-AnsibleParam -obj $params -name "start_mode" -type "str" -defau
$stdoutFile = Get-AnsibleParam -obj $params -name "stdout_file" -type "str"
$stderrFile = Get-AnsibleParam -obj $params -name "stderr_file" -type "str"
$dependencies = Get-AnsibleParam -obj $params -name "dependencies" -type "str"
$dependencies = Get-AnsibleParam -obj $params -name "dependencies" -type "list"
$user = Get-AnsibleParam -obj $params -name "user" -type "str"
$password = Get-AnsibleParam -obj $params -name "password" -type "str"
@ -431,11 +431,11 @@ Function Nssm-Update-Dependencies
Throw "Error updating dependencies for service ""$name"""
}
$dependencies_array = @($dependencies.split(" ") | where { $_ -ne '' })
$current_dependencies = @($nssm_result.stdout.split("`n`r") | where { $_ -ne '' })
If (@(Compare-Object -ReferenceObject $current_dependencies -DifferenceObject $dependencies_array).Length -ne 0) {
$cmd = "set ""$name"" DependOnService $dependencies"
If (@(Compare-Object -ReferenceObject $current_dependencies -DifferenceObject $dependencies).Length -ne 0) {
$dependencies_str = Argv-ToString -arguments $dependencies
$cmd = "set ""$name"" DependOnService $dependencies_str"
$nssm_result = Nssm-Invoke $cmd
if ($nssm_result.rc -ne 0)

View file

@ -58,7 +58,7 @@ options:
- Use either this or C(app_parameters), not both.
dependencies:
description:
- Service dependencies that has to be started to trigger startup, separated by space.
- Service dependencies that has to be started to trigger startup, separated by comma.
user:
description:
- User to be used for service startup.
@ -140,7 +140,7 @@ EXAMPLES = r'''
- win_nssm:
name: foo
application: C:\windows\foo.exe
dependencies: 'adf tcpip'
dependencies: 'adf,tcpip'
# Install and start the foo service with dedicated user
- win_nssm:

View file

@ -81,7 +81,7 @@
name: '{{ test_service_name }}'
application: C:\Windows\System32\cmd.exe
start_mode: manual
dependencies: 'tcpip dnscache'
dependencies: 'tcpip,dnscache'
user: '{{ test_win_nssm_username }}'
password: '{{ test_win_nssm_password }}'
stdout_file: '{{ test_win_nssm_path }}\log.txt'
@ -114,7 +114,7 @@
application: C:\Windows\System32\cmd.exe
start_mode: manual
# Dependencies order should not trigger a change
dependencies: 'dnscache tcpip'
dependencies: 'dnscache,tcpip'
user: '{{ test_win_nssm_username }}'
password: '{{ test_win_nssm_password }}'
stdout_file: '{{ test_win_nssm_path }}\log.txt'