Last active
April 20, 2016 16:23
-
-
Save martinb3/bf7cacdd69456afb9b0fb6171a2de69a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## On all servers: | |
knife ssh 'name:*' 'sudo chef-client’ | |
## On environment 'foo' only: | |
knife ssh 'chef_environment:foo' 'sudo chef-client' | |
## Search Examples (use with knife ssh) | |
knife search "name:ip*" | |
knife search "platform:ubuntu*" | |
knife search "platform:*" -a macaddress | |
knife search "platform:ubuntu*" -a uptime | |
knife search "platform:ubuntu*" -a virtualization.system | |
knife search "platform:ubuntu*" -a network.default_gateway | |
knife search "platform:*" -a languages.ruby.version | |
knife search "platform:*" -a kernel.machine | |
knife search users "groups:admin" -i | |
knife role list | |
## SSH Examples | |
knife ssh "name:arlo*" -x root -P PASSWORD uptime | |
knife ssh "NOT platform:win*" -P PASSWORD ls | |
knife ssh "chef_environment:Helix-Uptime-VM and NOT platform:win*" \ | |
-x root -P PASSWORD uptime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment