Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knife SSH attribute not working

Im confused by the knife ssh command. According to the docs you can pass the -a flag if your node does not have a FQDN or ipaddress attribute set. Also, if you want to override those attributes. I'm running this to test knife ssh on a local VM:

  $ knife ssh "role:webserver" "sudo chef-client" -x someusername -a 192.168.14.141

The error i receive:

FATAL: 1 node found, but does not have the required attribute to establish the connection. Try setting another attribute to open the connection using --attribute.

I am running Chef 11.4.0

like image 484
glenbot Avatar asked Apr 16 '13 13:04

glenbot


1 Answers

The -a argument actually means the name of the attribute which contains the IP address of the node, if the node[:fqdn] or node[:ipaddress] attributes are not set.

For example I have the openstack ohai plugin installed the public IPv4 address is stored in node[:openstack][:public_ipv4] I would write the knife ssh command like:

$ knife ssh "role:webserver" "sudo chef-client" -x user -a openstack_public_ipv4

where openstack_public_ipv4 is the search attribute format to match the node[:openstack][:public_ipv4] attribute.

like image 54
Tim Potter Avatar answered Oct 16 '22 01:10

Tim Potter