Closed rlakey closed 2 years ago
@clintoncwolfe any thoughts?
If there's a dep we need to add to workstation we can certainly do that, but we want to make sure we don't pull in every dep for train itself since sometimes these deps are quite enormous and get pulled into Chef Infra Client. It causes a lot of packaging problems and blocks us upgrading ruby.
Yea my original description may not be as accurate now. I didn't realize train was split up into multiple gems. In this case train and train-core and it seems that may be part of the issue traversing to the other gem to find the requirements.
What if we split the VMware transport into a plug-in?
@tas50 the issue is not a missing dependency. Seems like this use-case of VMware transport over powershell is not tested since this issue will only arise when running on powershell. This line attempts to load local.rb
transport which is not included in the built gem, nor are plugins and errors which local.rb
will attempt to include. See the gemspec regex
Aaron Lippold
@.***
260-255-4779
twitter/aim/yahoo,etc. 'aaronlippold'
On Tue, Sep 7, 2021 at 12:25 PM Kyle @.***> wrote:
@tas50 https://github.com/tas50 the issue is not a missing dependency. Seems like this use-case of VMware transport over powershell is not tested since this issue will only arise when running on powershell. This line https://github.com/inspec/train/blob/main/lib/train/transports/vmware.rb#L37 attempts to load local.rb transport which is not included in the built gem, nor are plugins and errors which local.rb will attempt to include. See the gemspec regex https://github.com/inspec/train/blob/main/train-core.gemspec#L23-L25
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/inspec/train/issues/693#issuecomment-914449301, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALK42GTE6BTYVOGLP6EF5LUAY4HXANCNFSM47BYEMWA .
One other piece of data I went through the process of setting up Powershell/PowerCLI on Ubuntu 20.04 today to test this and did not have a problem on InSpec 4.26.13 or 4.41.20 so it seems isolated to Windows.
So how do we want to keep this moving forward? Break things into a plugin or some other path?
Any update on this issue? I'm using the below resource pack to run profiles against our vmware enviroment, and inspec can't connect to vCenter on newer versions.
@rlakey does this problem occurs even when we use PowerCli on Windows as mentioned here https://github.com/chef-boneyard/inspec-vmware#install-powercli-on-windows-10-2016?
@jorgensoby Is your problem also the same that you are on Windows and have the PowerCli setup as mentioned in the readme docs of inspec-vmware
repo and it's not working for you?
@rlakey does this problem occurs even when we use PowerCli on Windows as mentioned here https://github.com/chef-boneyard/inspec-vmware#install-powercli-on-windows-10-2016?
Yea PowerCLI was installed from the Powershell gallery with that command. The "Set-PSRepository -Name "PSGallery" -InstallationPolicy "Trusted"" part I've never done but other than trying to use the vmware transport I've never had issues with PowerCLI.
Version:
3.5.2 and also seen in 3.7.2
Environment:
Running from a Windows 10 machine with workstation installed.
Scenario:
Executing profiles that use the vmware transport.
Steps to Reproduce:
Attempt to execute a profile with the vmware transport.
Expected Result:
The profile will execute using the vmware transport.
Actual Result:
The execution fails with an error that the vmware transport cannot load a dependency on the local.rb file which does not seem to be included in workstation or inspec installations in the right locations for the vmware transport.
The vmware transport is in the train-3.5.2 gem while local and the rest are in the train-core-3.5.2 gem. Maybe an issue with using require_relative for local instead of require?
Adding error info:
PS > inspec exec D:\inspec\Profiles\vmware-vsphere-vm-7.0-stig-baseline -t vmware:// --input vmName=**** --show-progress --reporter=cli
Traceback (most recent call last): 16: from D:/inspec/bin/inspec:272:in
<main>' 15: from D:/inspec/bin/inspec:272:in
load' 14: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-bin-4.37.30/bin/inspec:11:in<top (required)>' 13: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.37.30/lib/inspec/base_cli.rb:35:in
start' 12: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:485:instart' 11: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in
dispatch' 10: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:ininvoke_command' 9: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in
run' 8: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.37.30/lib/inspec/cli.rb:282:inexec' 7: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.37.30/lib/inspec/cli.rb:282:in
new' 6: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.37.30/lib/inspec/runner.rb:78:ininitialize' 5: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.37.30/lib/inspec/runner.rb:86:in
configure_transport' 4: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.37.30/lib/inspec/backend.rb:38:increate' 3: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.7.2/lib/train/transports/vmware.rb:16:in
connection' 2: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.7.2/lib/train/transports/vmware.rb:16:innew' 1: from D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.7.2/lib/train/transports/vmware.rb:37:in
initialize' D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.7.2/lib/train/transports/vmware.rb:37:in `require_relative': cannot load such file -- D:/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.7.2/lib/train/transports/local (LoadError)