Yoshi Spendiff | 27 Mar 18:28 2015

Ohai EC2 plugin error

Hi,

I'm having the same problem listed here: https://tickets.opscode.com/browse/OHAI-489
My Ohai version is 8.1.1 and chef-client version is 11.10.

This is the stack trace when I run ohai -l debug:

looks_like_ec2? == true
[2015-03-27T16:58:51+00:00] DEBUG: EC2 shows unsupported metadata version: 2014-11-05
[2015-03-27T16:58:51+00:00] DEBUG: EC2 shows unsupported metadata version: 2014-02-25
[2015-03-27T16:58:51+00:00] DEBUG: EC2 metadata version: 2012-01-12
[2015-03-27T16:58:51+00:00] DEBUG: EC2 shows unsupported metadata version: 2014-11-05
[2015-03-27T16:58:51+00:00] DEBUG: EC2 shows unsupported metadata version: 2014-02-25
[2015-03-27T16:58:51+00:00] DEBUG: EC2 metadata version: 2012-01-12
[2015-03-27T16:58:51+00:00] DEBUG: Plugin GCE threw #<SocketError: getaddrinfo: Name or service not known>
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/mixin/gce_metadata.rb:30:in `pack_sockaddr_in'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/mixin/gce_metadata.rb:30:in `can_metadata_connect?'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/plugins/gce.rb:30:in `has_gce_metadata?'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/plugins/gce.rb:39:in `looks_like_gce?'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/plugins/gce.rb:43:in `block (2 levels) in <main>'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin/versionvii.rb:90:in `instance_eval'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin/versionvii.rb:90:in `run_plugin'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin.rb:98:in `run'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/dsl/plugin.rb:169:in `safe_run'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/runner.rb:82:in `run_v7_plugin'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/runner.rb:43:in `run_plugin'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:94:in `block in run_plugins'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:93:in `each'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:93:in `run_plugins'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:71:in `all_plugins'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:90:in `run_application'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run'
[2015-03-27T16:58:51+00:00] DEBUG: /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>'
[2015-03-27T16:58:51+00:00] DEBUG: /usr/bin/ohai:23:in `load'
[2015-03-27T16:58:51+00:00] DEBUG: /usr/bin/ohai:23:in `<main>'

Is there a way around this? Looking at the ticket it looks like a fix was merged back in version 6.X and the issue is marked as resolved, but that's not the case for me.

--
Yoshi Spendiff
DevOps Engineer
Indochino
Mobile: +1 778 952 2025
Jay Mundrawala | 27 Mar 03:00 2015

Chef Client 12.2.0 Released

Happy Thursday Everyone,

Just released Chef Client 12.2.0. You can read all about it at https://www.chef.io/blog/2015/03/26/chef-client-12-2-0-released/

Thanks,
Jay
Fouts, Chris | 26 Mar 17:05 2015

How to install push-jobs for open source Chef server v11.1.6?

For chef 12 I used chef-server-ctl install opscode-push-jobs-server but that does not work for Chef 11 opensource?


Chris

Simon Hawkins | 26 Mar 15:13 2015

Knife Windows

Hi All,

 

I am following:

 

https://github.com/chef/knife-windows

 

And looking at the “knife windows cert generate” section, but when I run:

 

Knife-windows  - I get this:

 

FATAL: Cannot find sub command for: 'windows'

Available windows subcommands: (for details, knife SUB-COMMAND --help)

 

I’ve done a “gem install knife-windows” on my workstation and am using Chef: 12.1.2 on the workstation.

 

Am I missing a gem?

 

Cheers,

Simon.

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

Simon Hawkins | 26 Mar 12:54 2015

DataBags

Hi All,

 

I have a couple of windows recipes to join machines to domains and do some other stuff and I specify the username and password to do this in the registry – do you know if I can add this info into a databag and then put some kind of encrypted string into the recipe for the account details?

 

Cheers,

Simon.

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

Michael Dodwell | 26 Mar 00:58 2015
Picon

proxy

Hi,

So I'm administrating a private chef server behind a proxy/firewall. 

I have environment variables: http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY setup to allow things like gem and curl/wget to access internet sites. 

However when trying to do 'knife cookbook list' I get a 404 as the proxy isn't allowed to connect back into the network. 

I added a no_proxy to the knife.rb with a list of all the hosts internally to the network but it still appears that 'knife cookbook' still tries to go via the proxy settings in those environment variables. 

This is double annoying because if you -VV the (knife cookbook list) command it doesn't mention that it's doing this (connecting to proxy) so it was confusing when first discovered. 

Is this a bug? Or am i missing the point of no_proxy in my knife.rb?
Daniel DeLeo | 25 Mar 18:22 2015

Re: Re: User Management


On Wednesday, March 25, 2015 at 8:02 AM, ANGELA EBIRIM wrote:

> Hi,
>  
> Does anyone know how to extract the list of current users on a node?
>  
> I've been interrogating the OHAI attributes of a node (I'm sure it would be a node attribute) but can't find it.
>  
> Many thanks
Ohai fetches the data as etc/passwd, i.e., it should be under node[“etc”][“passwd”].

BTW, you can just run `ohai` on the command line to see all the data it produces. It’s quite a lot but you can
scan it to find the data you’re looking for. You can also filter the command line output by passing the
path to the attributes you want if you know them, e.g., `ohai etc/passwd` prints just the passwd data.

HTH,

--  
Daniel DeLeo

Michael Wehrle | 25 Mar 16:02 2015
Picon

yum package resource fails with "ImportError: No module named yum"

Heads up everyone, this morning my "Amazon Linux AMI 2014.09" servers starting failing upon attempting to install any package with chef-client. The failure looks like this for any "package" install you try:

[2015-03-25T14:49:09+00:00] INFO: Processing package[tzdata] action install (timezone-ii::default line 16)

================================================================================
Error executing action `install` on resource 'package[tzdata]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
STDOUT:
STDERR: Traceback (most recent call last):
  File "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py", line 36, in <module>
    import yum
ImportError: No module named yum
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 1


Resource Declaration:
---------------------
# In /root/.chef/local-mode-cache/cache/cookbooks/timezone-ii/recipes/default.rb

 16: )
 17:



Compiled Resource:
------------------
# Declared in /root/.chef/local-mode-cache/cache/cookbooks/timezone-ii/recipes/default.rb:16:in `from_file'

package("tzdata") do
  action :install
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "tzdata"
  cookbook_name "timezone-ii"
  recipe_name "default"
end


After investigation, I found that the package which I update in my userdata "aws-cfn-bootstrap" was updated sometime in the last 24 hours, updating its dependencies to install python27. yum-dump.py seems to be calling /usr/bin/python, which is symlinked to python2.6 after the 2.7 install. /usr/bin/yum header was updated to "#!/usr/bin/python2.7". The problem seems to be that the 2.7 install breaks 2.6 interactivity with yum.

[ec2-user <at> ip-10-47-30-60 ~]$ ls -al /usr/bin/python*
lrwxrwxrwx 1 root root   24 Mar 25 14:48 /usr/bin/python -> /etc/alternatives/python
lrwxrwxrwx 1 root root    9 Mar 25 14:48 /usr/bin/python2 -> python2.6
-rwxr-xr-x 1 root root 5120 Mar 18 19:36 /usr/bin/python26
-rwxr-xr-x 1 root root 5120 Mar 18 19:36 /usr/bin/python2.6
-rwxr-xr-x 1 root root 5120 Mar  4 20:43 /usr/bin/python27
-rwxr-xr-x 1 root root 5120 Mar  4 20:43 /usr/bin/python2.7
[ec2-user <at> ip-10-47-30-60 ~]$
[ec2-user <at> ip-10-47-30-60 ~]$
[ec2-user <at> ip-10-47-30-60 ~]$ /usr/bin/python2.6 /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides
Traceback (most recent call last):
  File "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py", line 36, in <module>
    import yum
ImportError: No module named yum
[ec2-user <at> ip-10-47-30-60 ~]$
[ec2-user <at> ip-10-47-30-60 ~]$
[ec2-user <at> ip-10-47-30-60 ~]$ /usr/bin/python2.7 /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/provider/package/yum-dump.py --options --installed-provides | head
[option installonlypkgs] kernel kernel-devel kernel-source installonlypkg(kernel) installonlypkg(kernel-module) installonlypkg(vm)
389-admin 0 1.1.35 1.11.amzn1 i686 [] a amzn-main
389-admin 0 1.1.35 1.11.amzn1 x86_64 [] a amzn-main
389-admin-console 0 1.1.8 3.1.amzn1 noarch [] a amzn-main
389-admin-console-doc 0 1.1.8 3.1.amzn1 noarch [] a amzn-main
389-adminutil 0 1.1.19 1.4.amzn1 i686 [] a amzn-main
389-adminutil 0 1.1.19 1.4.amzn1 x86_64 [] a amzn-main
389-adminutil-devel 0 1.1.19 1.4.amzn1 x86_64 [] a amzn-main
389-console 0 1.1.7 2.1.amzn1 noarch [] a amzn-main
389-ds 0 1.2.2 2.1.amzn1 noarch [] a amzn-main


My quick solution for this morning was to remove the update of the aws-cfn-bootstrap package from my userdata before chef-client runs.

If anyone has a more appropriate fix for this problem, let me know. If this is a bug, I will gladly file it for chef-client.


I updated to the latest chef-client, and this is still a problem. I suspect this might actually be a bug that needs to be reported?

Simon Hawkins | 25 Mar 15:54 2015

Ruby Gems

All,

 

When I am bootstrapping a windows box I get this:

 

20:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

21:  # See the License for the specific language governing permissions and

22:  # limitations under the License.

23:  #

24:

25:  if RUBY_PLATFORM =~ /mswin|mingw32|windows/

26:    require 'win32/registry'

27>>   require 'ruby-wmi'

28:  end

29:

30:  module Windows

31:    module RegistryHelper

 

Do I need ruby installed on my Windows Image before I can bootstrap it? Should the chef-client install push it out on a bootstrap?

 

Cheers,

Simon.

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861

Michael Weiner | 25 Mar 13:11 2015

Fwd: Mailing list


Hello. I am new to Chef and I was wondering if there is any tests on z/Linux and the s390x architecture.

Thanks!

Mike

--
Michael Weiner
Systems Admin
Infinity Systems Software, Inc.
One Penn Plaza Suite 2010
New York, NY 10119
o: (646) 405-9300
c: (845) 641-0517



--
Michael Weiner
Systems Admin
Infinity Systems Software, Inc.
One Penn Plaza Suite 2010
New York, NY 10119
o: (646) 405-9300
c: (845) 641-0517
Simon Hawkins | 25 Mar 10:24 2015

SSL Cert Error

Hi All,

 

I get the following error when trying to bootstrap a windows machine:

 

10.44.51.117 C:\Windows\system32>chef-client -c c:/chef/client.rb -j c:/chef/first-boot.json -E _default

10.44.51.117 [2015-03-25T09:14:28+00:00] INFO: *** Chef 12.1.2 ***

10.44.51.117 [2015-03-25T09:14:28+00:00] INFO: Chef-client pid: 2564

10.44.51.117 [2015-03-25T09:15:03+00:00] INFO: Client key c:/chef/client.pem is not present - registering

10.44.51.117 [2015-03-25T09:15:03+00:00] ERROR: SSL Validation failure connecting to host: myserver.local - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

10.44.51.117

10.44.51.117 ================================================================================

10.44.51.117 Chef encountered an error attempting to create the client "node3"

10.44.51.117 ================================================================================

10.44.51.117

10.44.51.117 [2015-03-25T09:15:03+00:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out

10.44.51.117 [2015-03-25T09:15:03+00:00] FATAL: NoMethodError: undefined method `run_id' for nil:NilClass

 

If on my chef workstation I run:

 

Knife ssl check

Connecting to host myserver.local:443

Successfully verified certificates from `myserver.local'

 

Do I somehow need to send the cert out on the chef-client run somehow so the machine I am bootstrapping can verify the cert?

 

Cheers,

Simon.

 

Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861


Gmane