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

EC2 plugin fails to detect Windows #781

Closed
meringu opened this issue Mar 22, 2016 · 2 comments
Closed

EC2 plugin fails to detect Windows #781

meringu opened this issue Mar 22, 2016 · 2 comments
Labels
Expeditor: Skip Version Bump Used to skip built_in:bump_version

Comments

@meringu
Copy link

meringu commented Mar 22, 2016

Description

Ohai consistently fails to detect it is running on an EC2 instance in windows.

This line could be problematic, https://github.com/chef/ohai/blob/master/lib/ohai/plugins/ec2.rb#L33

Ohai Version

ohai -v
Ohai: 8.8.1

Platform Version

Windows 2012r2

Ohai Output

When running

ohai -l debug ec2

I get

[2016-03-22T22:09:45+00:00] DEBUG: has_ec2_mac? == false
[2016-03-22T22:09:45+00:00] DEBUG: looks_like_ec2? == false
c:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/ohai-8.8.1/lib/ohai/system.rb:193:in `attributes_print': I cannot find
 an attribute named ec2! (ArgumentError)
    from c:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/ohai-8.8.1/lib/ohai/application.rb:94:in `block in run_application'
    from c:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/ohai-8.8.1/lib/ohai/application.rb:93:in `each'
    from c:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/ohai-8.8.1/lib/ohai/application.rb:93:in `run_application'
    from c:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/ohai-8.8.1/lib/ohai/application.rb:78:in `run'
    from c:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/ohai-8.8.1/bin/ohai:42:in `<top required)>'
    from c:/opscode/chef/bin/ohai:22:in `load'
    from c:/opscode/chef/bin/ohai:22:in `<main>'

cc @zl4bv

@mcquin
Copy link
Contributor

mcquin commented Mar 30, 2016

It'd be great to get automatic detection of EC2 for windows. :)

In the meantime, you can work around this by adding an ec2 hint to your node before your next chef-client run. There's a little documentation on hints, too.

@tas50
Copy link
Contributor

tas50 commented Apr 8, 2016

@meringu Hints are always going to be your best bet, but I've included improved auto detection for EC2 in #793 which includes detection of AWS Windows instances based on the owner data. This won't detect custom AMIs, but it will detect anything provided by Amazon. It should be included with the next Chef release if all goes as planned.

@tas50 tas50 closed this as completed Apr 8, 2016
@thommay thommay added Expeditor: Skip Version Bump Used to skip built_in:bump_version and removed Meta: Exclude From Changelog labels Sep 22, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Expeditor: Skip Version Bump Used to skip built_in:bump_version
Projects
None yet
Development

No branches or pull requests

4 participants