Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Module Empty File Path Warning #397

Closed
rclar802 opened this issue Aug 3, 2022 · 2 comments · Fixed by #398
Closed

Setup Module Empty File Path Warning #397

rclar802 opened this issue Aug 3, 2022 · 2 comments · Fixed by #398

Comments

@rclar802
Copy link

rclar802 commented Aug 3, 2022

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
  • Bug Report
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
Copy link
Author

@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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants