How can we upload cookbooks from the command lines?

As per subject. for chef 0.8, using the knife.

Thanks
Dikang

On Tue, Jan 12, 2010 at 7:02 AM, Dikang Gu dikang85@gmail.com wrote:

As per subject. for chef 0.8, using the knife.

http://wiki.opscode.com/display/chef/Knife#Knife-CookbookCommands

So something like:

sudo /var/lib/gems/1.8/bin/knife cookbook upload apache2 -u
chef-webui -k /etc/chef/webui.pem -o cookbooks

sudo -> because I'm using the webui key which has restrictive

permissions because I haven't created an user key yet

/var/lib/gems/1.8/bin/knife -> path to knife since I'm using debian rubygems

cookbook -> subcommand

upload -> option

apache2 -> name of cookbook

-u chef-webui -> user to authenticate as

-k /etc/chef/webui.pem -> users secret key

-o cookbooks -> path to folder where I have the cookbooks on my

filesystem I want to upload.

Ideally, though, you'll create yourself a user key:

knife configure --initial

(which will create you a key using the webui key)

You'll be prompted for the path to your chef-repo directory (which
should just be your local copy). Once htat's done, you can just:

knife cookbook upload apache2

And you'll be good to go.

Adam

On Tue, Jan 12, 2010 at 10:45 AM, Bryan McLellan btm@loftninjas.org wrote:

On Tue, Jan 12, 2010 at 7:02 AM, Dikang Gu dikang85@gmail.com wrote:

As per subject. for chef 0.8, using the knife.

http://wiki.opscode.com/display/chef/Knife#Knife-CookbookCommands

So something like:

sudo /var/lib/gems/1.8/bin/knife cookbook upload apache2 -u
chef-webui -k /etc/chef/webui.pem -o cookbooks

sudo -> because I'm using the webui key which has restrictive

permissions because I haven't created an user key yet

/var/lib/gems/1.8/bin/knife -> path to knife since I'm using debian rubygems

cookbook -> subcommand

upload -> option

apache2 -> name of cookbook

-u chef-webui -> user to authenticate as

-k /etc/chef/webui.pem -> users secret key

-o cookbooks -> path to folder where I have the cookbooks on my

filesystem I want to upload.

--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com

Yes, it does work!

Thank you! :slight_smile:
Dikang

On Wed, Jan 13, 2010 at 3:45 AM, Adam Jacob adam@opscode.com wrote:

Ideally, though, you'll create yourself a user key:

knife configure --initial

(which will create you a key using the webui key)

You'll be prompted for the path to your chef-repo directory (which
should just be your local copy). Once htat's done, you can just:

knife cookbook upload apache2

And you'll be good to go.

Adam

On Tue, Jan 12, 2010 at 10:45 AM, Bryan McLellan btm@loftninjas.org
wrote:

On Tue, Jan 12, 2010 at 7:02 AM, Dikang Gu dikang85@gmail.com wrote:

As per subject. for chef 0.8, using the knife.

http://wiki.opscode.com/display/chef/Knife#Knife-CookbookCommands

So something like:

sudo /var/lib/gems/1.8/bin/knife cookbook upload apache2 -u
chef-webui -k /etc/chef/webui.pem -o cookbooks

sudo -> because I'm using the webui key which has restrictive

permissions because I haven't created an user key yet

/var/lib/gems/1.8/bin/knife -> path to knife since I'm using debian

rubygems

cookbook -> subcommand

upload -> option

apache2 -> name of cookbook

-u chef-webui -> user to authenticate as

-k /etc/chef/webui.pem -> users secret key

-o cookbooks -> path to folder where I have the cookbooks on my

filesystem I want to upload.

--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com

could we upload multiple cookbooks at one time?...

On Wed, Jan 13, 2010 at 6:08 PM, Dikang Gu dikang85@gmail.com wrote:

Yes, it does work!

Thank you! :slight_smile:
Dikang

On Wed, Jan 13, 2010 at 3:45 AM, Adam Jacob adam@opscode.com wrote:

Ideally, though, you'll create yourself a user key:

knife configure --initial

(which will create you a key using the webui key)

You'll be prompted for the path to your chef-repo directory (which
should just be your local copy). Once htat's done, you can just:

knife cookbook upload apache2

And you'll be good to go.

Adam

On Tue, Jan 12, 2010 at 10:45 AM, Bryan McLellan btm@loftninjas.org
wrote:

On Tue, Jan 12, 2010 at 7:02 AM, Dikang Gu dikang85@gmail.com wrote:

As per subject. for chef 0.8, using the knife.

http://wiki.opscode.com/display/chef/Knife#Knife-CookbookCommands

So something like:

sudo /var/lib/gems/1.8/bin/knife cookbook upload apache2 -u
chef-webui -k /etc/chef/webui.pem -o cookbooks

sudo -> because I'm using the webui key which has restrictive

permissions because I haven't created an user key yet

/var/lib/gems/1.8/bin/knife -> path to knife since I'm using debian

rubygems

cookbook -> subcommand

upload -> option

apache2 -> name of cookbook

-u chef-webui -> user to authenticate as

-k /etc/chef/webui.pem -> users secret key

-o cookbooks -> path to folder where I have the cookbooks on my

filesystem I want to upload.

--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com

You can upload all the cookbooks with knife cookbook upload -a.

Feel free to file a feature request ticket to get multiple cookbooks
in one pass.

Adam

On Fri, Jan 22, 2010 at 1:18 AM, Dikang Gu dikang85@gmail.com wrote:

could we upload multiple cookbooks at one time?...

On Wed, Jan 13, 2010 at 6:08 PM, Dikang Gu dikang85@gmail.com wrote:

Yes, it does work!
Thank you! :slight_smile:
Dikang

On Wed, Jan 13, 2010 at 3:45 AM, Adam Jacob adam@opscode.com wrote:

Ideally, though, you'll create yourself a user key:

knife configure --initial

(which will create you a key using the webui key)

You'll be prompted for the path to your chef-repo directory (which
should just be your local copy). Once htat's done, you can just:

knife cookbook upload apache2

And you'll be good to go.

Adam

On Tue, Jan 12, 2010 at 10:45 AM, Bryan McLellan btm@loftninjas.org
wrote:

On Tue, Jan 12, 2010 at 7:02 AM, Dikang Gu dikang85@gmail.com wrote:

As per subject. for chef 0.8, using the knife.

http://wiki.opscode.com/display/chef/Knife#Knife-CookbookCommands

So something like:

sudo /var/lib/gems/1.8/bin/knife cookbook upload apache2 -u
chef-webui -k /etc/chef/webui.pem -o cookbooks

sudo -> because I'm using the webui key which has restrictive

permissions because I haven't created an user key yet

/var/lib/gems/1.8/bin/knife -> path to knife since I'm using debian

rubygems

cookbook -> subcommand

upload -> option

apache2 -> name of cookbook

-u chef-webui -> user to authenticate as

-k /etc/chef/webui.pem -> users secret key

-o cookbooks -> path to folder where I have the cookbooks on my

filesystem I want to upload.

--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com

--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com