{"id":13905967,"url":"https://github.com/knife-block/knife-block","last_synced_at":"2025-07-18T03:32:40.702Z","repository":{"id":2831361,"uuid":"3834018","full_name":"knife-block/knife-block","owner":"knife-block","description":"Create and use multiple knife.rb files in Chef","archived":false,"fork":false,"pushed_at":"2017-09-25T22:21:33.000Z","size":92,"stargazers_count":157,"open_issues_count":9,"forks_count":45,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-31T14:55:34.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/knife-block/versions/0.2.1","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knife-block.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-26T15:09:10.000Z","updated_at":"2024-01-13T23:50:41.000Z","dependencies_parsed_at":"2022-08-20T23:40:17.105Z","dependency_job_id":null,"html_url":"https://github.com/knife-block/knife-block","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knife-block%2Fknife-block","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knife-block%2Fknife-block/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knife-block%2Fknife-block/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knife-block%2Fknife-block/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knife-block","download_url":"https://codeload.github.com/knife-block/knife-block/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226344474,"owners_count":17610141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T23:01:27.130Z","updated_at":"2024-11-25T14:30:37.899Z","avatar_url":"https://github.com/knife-block.png","language":"Ruby","readme":"# Knife Block\n\nThe knife block plugin has been created to enable the use of multiple knife.rb files against multiple chef servers.\n\nThe premise is that you have a \"block\" in which you store all your \"knives\" and you can choose the one best suited to the task.\n\n![Knife Block](/assets/knife-block.png)\n\n## Requirements\n\nAt present, knife-block requires ruby 1.9.2 or above.  This is owing to the use of \"Dir.home()\" to find a user's home directory.\n\n## Installation\n\nIf you've installed Chef via rubygems, homebrew, etc, then install using\n\n    gem install knife-block\n\nIf you've installed Chef via ChefDK, then install using\n\n    chef gem install knife-block\n\n### How does it work?\n\nKnife looks for knife.rb in ~/.chef - all this script does is create a symlink from the required configuration to knife.rb so that knife can act on the appropriate server.\n\nCreate a knife-\u0026lt;service_name\u0026gt;.rb configuration file in your ~/.chef directory for each Chef server that you wish to connect to.\n\n**Please note - this script will check to see if knife.rb exists and whether it is a symlink or not.**\n\n**If knife.rb is *not* a symlink, the program will exit immediately and tell you what to do.**\n\n#### List all available servers\n(This command will also tell you which server is currently selected)\n\n    knife block list\n\n    The available chef servers are:\n        * local-testing [ Currently Selected ]\n        * opscode-hosted-chef\n\n#### Change to a new server\n    knife block use \u003cserver_name\u003e\n\n    You are asking to change from local-testing to opscode-hosted-chef. Are you sure? (Y/N) y\n    The knife configuration has been updated to use opscode-hosted-chef\n\n#### Create a new server\n(Launches \"knife configure\" and creates $HOME/.chef/knife-\u0026lt;friendlyname\u0026gt;.rb)\n\n    knife block new \u003cfriendlyname\u003e\n\n\n### Berkshelf integration\nKnife block supports Berkshelf, however, the berkshelf config files must be manually created and named \"config-\u0026lt;block\u0026gt;.json\" and put in the Berkshelf directory (typically ~/.berkshelf). In the future, these files could be automatically created by knife block.\n\nInformation about the Berkshelf configuration file options can be found at http://berkshelf.com/ in the 'Configuring Berkshelf' section.\n\nThe general format of the config file looks something like this.\n\n    {\n      \"chef\":{\n          \"chef_server_url\":\"\u003cserver_url\u003e\",\n          \"client_key\":\"\u003cpath_to_chef_client_key\u003e\",\n          \"node_name\":\"\u003cchef_node_name\u003e\"\n        }\n    }\n\n\nThese knife plugins are supplied without any warranty or guarantees regarding suitability for purpose.\n\nThe code requires far more tests than the simple one that currently exists.\n\nHaving said all of that, it works for us!\n\nCopyright:\n- Brandon Burton, 2015\n- Green and Secure IT Limited, 2012 - 2015\n\nLicense: Apache 2 (http://apache.org/licenses/LICENSE-2.0.html)\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknife-block%2Fknife-block","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknife-block%2Fknife-block","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknife-block%2Fknife-block/lists"}