opscode/chef — pull request #1130 by philsturgeon (2013-11-15 22:33:35+00:00)
Title: Doc fix to highlight that -E is not respected by knife ssh [search] 

I noticed this when my production server host names were being listed in Chef activity after switching to a new deployment tactic. For example, it's fairly safe to assume that the command below will only run on staging:

$ knife ssh -E stag "role:api" "foo"

Actually it runs on ANY node with role:api, which is not only unexpected but ludicrously dangerous in the case of deployments.

You can do this:

$ knife ssh "chef_environment:stag AND role:api" "foo"

I did that after doing an emergency rollback. I'd like this documentation change to be done to avoid that happening to others. Happy to change wording of course.