mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix logic to ensure state is either present or absent
This commit is contained in:
committed by
Matt Martz
parent
630c0cf57e
commit
ba4b2d04d9
@@ -37,8 +37,8 @@ Else {
|
|||||||
|
|
||||||
If ($params.state) {
|
If ($params.state) {
|
||||||
$state = $params.state.ToString().ToLower()
|
$state = $params.state.ToString().ToLower()
|
||||||
If (!($state -eq 'present') -or ($state -eq 'absent')) {
|
If (($state -ne 'present') -and ($state -ne 'absent')) {
|
||||||
Fail-Json $result "state must be 'present' or 'absent'"
|
Fail-Json $result "state is '$state'; must be 'present' or 'absent'"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user