Any rake task or plugin to upload all environments

Ohai!

Is there any knife or rake task or plugin to upload all the environments files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

knife environment from file environments/*.rb

Cheers,

--AJ
On Sep 2, 2012 12:44 AM, "Sachin Sagar Rai" millisami@gmail.com wrote:

Ohai!

Is there any knife or rake task or plugin to upload all the environments
files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow http://www.sparrowmailapp.com/?sig

Thanks!

Via Millisami'z iPhone

On Sep 6, 2012, at 8:28 AM, AJ Christensen aj@junglist.gen.nz wrote:

knife environment from file environments/*.rb

Cheers,

--AJ

On Sep 2, 2012 12:44 AM, "Sachin Sagar Rai" millisami@gmail.com wrote:
Ohai!

Is there any knife or rake task or plugin to upload all the environments files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

Actually knife environment from file environments/*.rb does not work
as expected - it uploads only the first environment in this directory.

knife role from file roles/*.rb though works as expected and uploads
all roles from the roles directory.

Both of the above were tested with Chef 10.14.4 on a Windows 7 box.

I have added a comment to http://tickets.opscode.com/browse/CHEF-1914

-Torben

On Sat, Sep 15, 2012 at 3:20 PM, Joshua Timberman joshua@opscode.com wrote:

Any of the "from file" knife commands should be able to use dir/*.{rb,json} to upload all those files in the directory. For example, roles:

knife role from file roles/*.rb

Uploads all the Ruby DSL role files. Likewise, for environments:

knife environment from file environments/*.rb

Would do the same for environments. The from file commands use the same class to do the file loading.

On Sep 15, 2012, at 4:37, "AJ Christensen" aj@junglist.gen.nz wrote:

Oh, weird. Thought I had used that, maybe it was my shell expansion or
similar? I'll check next time I can.

Did we get a knife environment from file -a yet ?

Similarly, something like this might work: for i in environments/*.rb;
do knife environment from file ${i} ; done

--AJ

On 15 September 2012 22:23, Sachin Sagar Rai millisami@gmail.com wrote:

Hi,
But that command just upload only one env file?

Can you send me the version of the knife that you'd use?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

On Thursday, September 6, 2012 at 1:21 PM, Millisi wrote:

Thanks!

Via Millisami'z iPhone

On Sep 6, 2012, at 8:28 AM, AJ Christensen aj@junglist.gen.nz wrote:

knife environment from file environments/*.rb

Cheers,

--AJ

On Sep 2, 2012 12:44 AM, "Sachin Sagar Rai" millisami@gmail.com wrote:

Ohai!

Is there any knife or rake task or plugin to upload all the environments
files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

On Thu, Oct 4, 2012 at 2:06 AM, Torben Knerr ukio@gmx.de wrote:

Actually knife environment from file environments/*.rb does not work
as expected - it uploads only the first environment in this directory.

knife role from file roles/*.rb though works as expected and uploads
all roles from the roles directory.

knife environment from file was a little naive. I've put together a
patch on CHEF-1914.

Bryan

On Thu, Oct 4, 2012 at 7:10 PM, Bryan McLellan btm@loftninjas.org wrote:

On Thu, Oct 4, 2012 at 2:06 AM, Torben Knerr ukio@gmx.de wrote:

Actually knife environment from file environments/*.rb does not work
as expected - it uploads only the first environment in this directory.

knife role from file roles/*.rb though works as expected and uploads
all roles from the roles directory.

knife environment from file was a little naive. I've put together a
patch on CHEF-1914.

Bryan

Awesome, thanks! :slight_smile:

Hi,
But that command just upload only one env file?

Can you send me the version of the knife that you'd use?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Thursday, September 6, 2012 at 1:21 PM, Millisi wrote:

Thanks!

Via Millisami'z iPhone

On Sep 6, 2012, at 8:28 AM, AJ Christensen <aj@junglist.gen.nz (mailto:aj@junglist.gen.nz)> wrote:

knife environment from file environments/*.rb
Cheers,
--AJ
On Sep 2, 2012 12:44 AM, "Sachin Sagar Rai" <millisami@gmail.com (mailto:millisami@gmail.com)> wrote:

Ohai!

Is there any knife or rake task or plugin to upload all the environments files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

Oh, weird. Thought I had used that, maybe it was my shell expansion or
similar? I'll check next time I can.

Did we get a knife environment from file -a yet ?

Similarly, something like this might work: for i in environments/*.rb;
do knife environment from file ${i} ; done

--AJ

On 15 September 2012 22:23, Sachin Sagar Rai millisami@gmail.com wrote:

Hi,
But that command just upload only one env file?

Can you send me the version of the knife that you'd use?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

On Thursday, September 6, 2012 at 1:21 PM, Millisi wrote:

Thanks!

Via Millisami'z iPhone

On Sep 6, 2012, at 8:28 AM, AJ Christensen aj@junglist.gen.nz wrote:

knife environment from file environments/*.rb

Cheers,

--AJ

On Sep 2, 2012 12:44 AM, "Sachin Sagar Rai" millisami@gmail.com wrote:

Ohai!

Is there any knife or rake task or plugin to upload all the environments
files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

Any of the "from file" knife commands should be able to use dir/*.{rb,json} to upload all those files in the directory. For example, roles:

knife role from file roles/*.rb

Uploads all the Ruby DSL role files. Likewise, for environments:

knife environment from file environments/*.rb

Would do the same for environments. The from file commands use the same class to do the file loading.

On Sep 15, 2012, at 4:37, "AJ Christensen" aj@junglist.gen.nz wrote:

Oh, weird. Thought I had used that, maybe it was my shell expansion or
similar? I'll check next time I can.

Did we get a knife environment from file -a yet ?

Similarly, something like this might work: for i in environments/*.rb;
do knife environment from file ${i} ; done

--AJ

On 15 September 2012 22:23, Sachin Sagar Rai millisami@gmail.com wrote:

Hi,
But that command just upload only one env file?

Can you send me the version of the knife that you'd use?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

On Thursday, September 6, 2012 at 1:21 PM, Millisi wrote:

Thanks!

Via Millisami'z iPhone

On Sep 6, 2012, at 8:28 AM, AJ Christensen aj@junglist.gen.nz wrote:

knife environment from file environments/*.rb

Cheers,

--AJ

On Sep 2, 2012 12:44 AM, "Sachin Sagar Rai" millisami@gmail.com wrote:

Ohai!

Is there any knife or rake task or plugin to upload all the environments
files with single command?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

On 9/15/12 3:23 AM, Sachin Sagar Rai wrote:

Hi,
But that command just upload only one env file?

Can you send me the version of the knife that you'd use?

You might also be interested in knife-essentials:

which allows you to simply do:

knife upload environments/*

Cheers,

Steven

--
Steven Danna
Systems Engineer, Opscode, Inc
GPG Key: http://stevendanna.github.com/downloads/code/public.key