-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add VMware transport #321
Add VMware transport #321
Conversation
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only major change is a request to update the README, and consider the transport's placement in the platform tree.
@@ -11,6 +11,8 @@ def self.load | |||
plat.name('aws').in_family('cloud') | |||
plat.name('azure').in_family('cloud') | |||
plat.name('gcp').in_family('cloud') | |||
plat.name('vmware').in_family('cloud') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Methinks vmware might be a member of iaas, not cloud. But that may be a marketing distinction, here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I struggled with this as well. After discussing, @jquick and @chris-rock decided that is should be under cloud
.
stub_options: { | ||
powershell_binary: :powershell | ||
} | ||
).connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a test assertion in this block - is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I expect it to create a Local::Connection
if the PowerShell binary is proper PowerShell (vs pwsh
).
So I did an expect
, then created the connection. Is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I see. the expects
should fire. Too many testing paradigms on this project :-)
) | ||
} | ||
).connection | ||
}.must_raise(RuntimeError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more specific exception class you could catch? You're testing a very specific circumstance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm...should I raise a different error? My plan was to ensure it raises, capture the exception in e
then make sure the message is what I expect.
def initialize(options) | ||
super(options) | ||
|
||
options[:viserver] = options[:viserver] || options[:host] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun shorthand: try ||=
. Like +=
, but for or. It's great for setting defaults.
options[:viserver] ||= options[:host]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it is, will do!
end | ||
|
||
def local? | ||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, I'm trying to override:
def local? |
@@ -0,0 +1,190 @@ | |||
# encoding: utf-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot going on here that I really wish we had integration tests for. The unit tests are solid - I believe that the accessors and option parsers work. I'm sure info about integration testing is coming, likely in the resource pack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I too would like integration tests, I'm just not quite sure how to approach it here.
@@ -0,0 +1,190 @@ | |||
# encoding: utf-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, pleas update the README.md to include vmware, and provide configuration information there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added sections covering basic usage. Detailed info (such as PWSH/PowerCLI installation will be in the resource pack).
Does that work for you? 😄
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jerryaldrichiii
Support for VMware via PowerCLI was added to InSpec/Train. See: - inspec/inspec#3195 - inspec/train#321 This removes the current code in favor of using InSpec's PowerCLI implementation. Currently, the only supported resource is `powercli_command`, but future resources are planned. If you would like to continue using the old method, you can access it via GitHub's tagging mechanism. Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
Support for VMware via PowerCLI was added to InSpec/Train. See: - inspec/inspec#3195 - inspec/train#321 This removes the current code in favor of using InSpec's PowerCLI implementation. Currently, the only supported resource is `powercli_command`, but future resources are planned. If you would like to continue using the old method, you can access it via GitHub's tagging mechanism. Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Update version for pre-migration tagging Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com> * Convert repo to use InSpec's PowerCLI support Support for VMware via PowerCLI was added to InSpec/Train. See: - inspec/inspec#3195 - inspec/train#321 This removes the current code in favor of using InSpec's PowerCLI implementation. Currently, the only supported resource is `powercli_command`, but future resources are planned. If you would like to continue using the old method, you can access it via GitHub's tagging mechanism. Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com> * Respond to feedback Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This adds the VMware transport via PowerCLI.
See: inspec/inspec#3133