Bootstrapping a system
knife bootstrap systemname-x username -P password --sudoInstalling a cookbook from the central repository
knife cookbook site install name-of-cookbookUploading a cookbook to the server
knife cookbook upload name-of-cookbookAdding a recipe to a system
knife node run_list add HOSTNAME 'recipe[recipe]'
Updating all systems
knife ssh "*:*" "sudo chef-client" -x username -P passwordUpdating/Adding a data bag
knife data bag from file BAG_NAME ITEM.jsonChanging the environment for nodes
knife exec -E 'nodes.transform("chef_environment:dev") { |n| n.chef_environment("production") }'
knife exec -E 'nodes.transform("chef_environment:Fiehnlab") {|n| puts n.run_list << "role[user-management]"; n.save }'Overriding the runlist for a single run
chef-client -o recipe["rocks-cluster-6.1::computenode"]
Just a small overview for me to remember some commands.
No comments:
Post a Comment