mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
win_owner: added tests and fixed up bool handling (#25088)
* win_owner: added tests and fixed up bool handling * explicitly gathering facts in test * Removed manualy entry in test group
This commit is contained in:
parent
0aba04fdad
commit
c05d3c3821
5 changed files with 239 additions and 6 deletions
|
@ -90,7 +90,7 @@ $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "b
|
|||
|
||||
$path = Get-AnsibleParam -obj $params -name "path" -type "path" -failifempty $true
|
||||
$user = Get-AnsibleParam -obj $params -name "user" -type "str" -failifempty $true
|
||||
$recurse = Get-AnsibleParam -obj $params -name "recurse" -type "bool" -default "no" -validateset "no","yes" -resultobj $result
|
||||
$recurse = Get-AnsibleParam -obj $params -name "recurse" -type "bool" -default $false -resultobj $result
|
||||
|
||||
If (-Not (Test-Path -Path $path)) {
|
||||
Fail-Json $result "$path file or directory does not exist on the host"
|
||||
|
@ -129,7 +129,7 @@ Try {
|
|||
}
|
||||
}
|
||||
Catch {
|
||||
Fail-Json $result "an error occurred when attempting to change owner on $path for $user"
|
||||
Fail-Json $result "an error occurred when attempting to change owner on $path for $($user): $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
Exit-Json $result
|
||||
|
|
|
@ -45,10 +45,8 @@ options:
|
|||
recurse:
|
||||
description:
|
||||
- Indicates if the owner should be changed recursively
|
||||
choices:
|
||||
- no
|
||||
- yes
|
||||
default: no
|
||||
type: bool
|
||||
default: 'no'
|
||||
author: Hans-Joachim Kliemeck (@h0nIg)
|
||||
'''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue