If you received error uploading cookbook to chef server:
knife cookbook upload rundeck
Uploading rundec
ERROR: Cookbook rundeck depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'java' version '>= 0.0.0', 'yum' version '>= 0.0.0', 'apt' version '>= 0.0.0', 'supervisor' version '>= 0.0.0', 'database' version '>= 0.0.0', 'mysql2_chef_gem' version '~> 1.0.2', 'mysqld' version '~> 1.0.3'
You need use berkshelf tool which bundled with the chefdk package.
It's really easy to use and worth learning. It's designed to work like the gem bundler tool.
└── myCookbook
├── Berksfile <-- Berkshelf configuration file
├── Berksfile.lock <-- Lock file generated by Berkshelf
├── metadata.rb
├── README.md
└── recipes
└── default.rb
Berksfile
source 'https://supermarket.chef.io'
metadata
The "source" directive tells berkshelf where to download dependencies from. The "metadata" directive tells berkshelf to take dependencies from the cookbook metadata.
Using Berkshelf
The "install" command will download the cookbook dependencies (Cached under ~/.berkshelf)
#cd rundeck
# berks install
Resolving cookbook dependencies...
Fetching 'rundeck' from source at .
Fetching cookbook index from https://supermarket.chef.io...
Installing apt (2.8.2)
Installing build-essential (2.2.3)
Installing chef-sugar (3.1.1)
Installing database (4.0.9)
Installing java (1.35.0)
Installing mariadb (0.3.1)
Installing mysql (6.1.2)
Installing mysql2_chef_gem (1.0.2)
Installing mysqld (1.0.3)
Installing openssl (4.4.0)
Installing postgresql (3.4.16)
Installing python (1.4.6)
Installing rbac (1.0.3)
Using rundeck from source at .
Installing smf (2.2.7)
Installing supervisor (0.4.12)
Installing yum (3.7.1)
Installing yum-epel (0.6.3)
Installing yum-mysql-community (0.1.18)
Berkshelf can also upload all the cookbooks into your chef server: $ berks upload
# knife cookbook upload rundeck –include-dependencies
Uploading rundeck
Uploading java [1.35.0]
Uploading yum [3.7.1]
Uploading apt [2.8.2]
Uploading supervisor [0.4.12]
Uploading database [4.0.9]
Uploading mysql2_chef_gem [1.0.2]
Uploading mysqld [1.0.3]
Uploading python [1.4.6]
Uploading postgresql [3.4.16]
Uploading build-essential [2.2.3]
Uploading mysql [6.1.2]
Uploading mariadb [0.3.1]
Uploading yum-epel [0.6.3]
Uploading openssl [4.4.0]
Uploading yum-mysql-community [0.1.18]
Uploading smf [2.2.7]
Uploading chef-sugar [3.1.1]
Uploading rbac [1.0.3]
Leave a Reply