chef & knife - use knife ssh

Example

knife ssh -x sysadmin.a -a ipaddress "chef_environment:stage" uptime

  • always define the user with -x
  • always give the ssh attribute -a ipaddress for knife to rely on the ip attributes of the search query result
  • the actual search query goes along standard knife search syntax
  • remember quotes around constructed commands, in particular sudo do_this
Andreas Wagner