ansible-collections / ansible.windows

Windows core collection for Ansible
https://galaxy.ansible.com/ansible/windows
GNU General Public License v3.0
248 stars 169 forks source link

Setup Module Empty File Path Warning #397

Closed rclar802 closed 2 years ago

rclar802 commented 2 years ago
SUMMARY

Ansible Setup module providing the below warnings:

[WARNING]: Error when collecting facter facts: Join-Path : Cannot find drive. A drive with the name 'z' does not exist. At line:9 char:31 + ... $facterPath = Join-Path -Path $_ -ChildPath facter.exe + ~~~~~~~~ + CategoryInfo : ObjectNotFound: (z:String) [Join-Path], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand at , : line 9 at , : line 3 [WARNING]: Error when collecting facter facts: Test-Path : Cannot bind argument to parameter 'LiteralPath' because it is null. At line:10 char:40 + Test-Path -LiteralPath $facterPath + ~~~ + CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand at , : line 10 at , : line 3

ISSUE TYPE
COMPONENT NAME

setup module

ANSIBLE VERSION
ansible 2.11.5
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT

RHEL_8

STEPS TO REPRODUCE

name: Gather facts
setup:
gather_timeout: 10
until:
retries:
delay:
EXPECTED RESULTS

No Warnings

ACTUAL RESULTS
$facterPath = Join-Path -Path $_ -ChildPath facter.exe  +                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      + CategoryInfo          :
ObjectNotFound: (z:String) [Join-Path], DriveNotFoundException      + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand      at
<ScriptBlock>, <No file>: line 9  at <ScriptBlock>, <No file>: line 3
[WARNING]: Error when collecting facter facts: Test-Path : Cannot bind argument to parameter 'LiteralPath' because it is null.  At line:10 char:40  +
Test-Path -LiteralPath $facterPath  +                                        ~~~~~~~~~~~      + CategoryInfo          : InvalidData: (:) [Test-Path],
ParameterBindingValidationException      + FullyQualifiedErrorId :   ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand      at
<ScriptBlock>, <No file>: line 10  at <ScriptBlock>, <No file>: line 3
rclar802 commented 2 years ago

@jborean93 I see you deleted the setup-factor-path, does this fix the warning? And what version of ansible will this be fixed under?

jborean93 commented 2 years ago

I just merged the PR which should fix the problem you found here. It will be present in the next release of ansible.windows which is typically picked up by the next Ansible release. You can always update the collection yourself though to get these new changes independently of Ansible.