You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by dan rusak <me...@rseincorp.com> on 2014/08/08 16:00:27 UTC

Utilize a local cookbook to provision a remote

Hi, 

I need the ability to use a cookbook sourced from a platform, not a remote
repository. So far

all I can find are examples that use github repos or just notes that make a
reference to uploading files over SshClient to

a node and running a script on that node to use that path for its cookbooks.
This seems very painful and awkward.

(More so because I have yet to find a function that will upload an entire
directory without resorting to

spinning through one file at a time).

Surely there must be a class/function to accept a local path instead of a
repository in building the run scripts?

 

-thx

-d


RE: Utilize a local cookbook to provision a remote

Posted by Ignasi Barrera <ig...@gmail.com>.
In theory that should work, but the Chef Solo docs [1] are not detailed.
I've not tried that, but if it does not work you can untar after uploading
and configure the cookbook dir accordingly.

[1] http://docs.getchef.com/chef_solo.html#cookbooks
El 08/08/2014 19:20, "dan rusak" <me...@rseincorp.com> escribió:

> Chef Solo .. I was familiar with those links but missed the significance of utilizing “cookbooksArchiveLocation” .. I assume then I can
>
> sshclient upload a single zipped cookbooksfile into the node /tmp and use ‘cookbooksArchiveLocation(file:///tmp/cookbooks.tar.gz)’ with the
>
> ‘file’ locator ..
>
>
>
> -thx
>
> -d
>
>
>
> *From:* Ignasi Barrera [mailto:ignasi.barrera@gmail.com]
> *Sent:* Friday, August 08, 2014 8:28 AM
> *To:* user@jclouds.apache.org
> *Subject:* Re: Utilize a local cookbook to provision a remote
>
>
>
> I assume you're talking about Chef.
>
> You can use Chef in two ways: with a Chef Server or using Chef Solo.
>
> If you use a Chef Server, then the cookbooks and hosted there (that means
> all cookbooks must be uploaded there before they can be used) and the node
> will download the required ones as part of its bootstrap process. You will
> find an example of using jclouds with a Chef Server in the Chef User Guide
> [1].
>
> If you don't have a Chef Server then you'll have to use Chef Solo. Chef
> Solo doesn't use a Chef Server nor a "remote cookbook repository", so that
> means the cookbooks must exist locally in the node before Chef Solo is run.
>
> The way you get the cookbooks there is completely up to you. You can use
> the SshClient to upload them, you can have them in a git repo and clone the
> repo when starting the node, you can provide a publicly available URL to a
> cookbook archive (a .tar.gz with all the cookbooks), or whatever, but
> cookbooks need to be in the node. You can see an example of using Chef Solo
> with Git in the jclouds-examples repo [2] and the cookbook archive approach
> in this blog post [3].
>
> HTH!
>
> I.
>
> [1] http://jclouds.apache.org/guides/chef/
> [2]
> https://github.com/jclouds/jclouds-examples/blob/master/chef-basics/src/main/java/org/apache/jclouds/examples/chef/basics/MainApp.java#L167-193
> [3]
> http://www.abiquo.com/2012/11/12/cooking-your-own-configuration-in-the-cloud/
>
> El 08/08/2014 16:00, "dan rusak" <me...@rseincorp.com> escribió:
>
> Hi,
>
> I need the ability to use a cookbook sourced from a platform, not a remote
> repository. So far
>
> all I can find are examples that use github repos or just notes that make
> a reference to uploading files over SshClient to
>
> a node and running a script on that node to use that path for its
> cookbooks. This seems very painful and awkward.
>
> (More so because I have yet to find a function that will upload an entire
> directory without resorting to
>
> spinning through one file at a time).
>
> Surely there must be a class/function to accept a local path instead of a
> repository in building the run scripts?
>
>
>
> -thx
>
> -d
>

RE: Utilize a local cookbook to provision a remote

Posted by dan rusak <me...@rseincorp.com>.
Chef Solo .. I was familiar with those links but missed the significance of utilizing “cookbooksArchiveLocation” .. I assume then I can
sshclient upload a single zipped cookbooksfile into the node /tmp and use ‘cookbooksArchiveLocation(file:///tmp/cookbooks.tar.gz <file:///\\tmp\cookbooks.tar.gz> )’ with the
‘file’ locator ..
 
-thx
-d

 

From: Ignasi Barrera [mailto:ignasi.barrera@gmail.com] 
Sent: Friday, August 08, 2014 8:28 AM
To: user@jclouds.apache.org
Subject: Re: Utilize a local cookbook to provision a remote

 

I assume you're talking about Chef.

You can use Chef in two ways: with a Chef Server or using Chef Solo.

If you use a Chef Server, then the cookbooks and hosted there (that means all cookbooks must be uploaded there before they can be used) and the node will download the required ones as part of its bootstrap process. You will find an example of using jclouds with a Chef Server in the Chef User Guide [1].

If you don't have a Chef Server then you'll have to use Chef Solo. Chef Solo doesn't use a Chef Server nor a "remote cookbook repository", so that means the cookbooks must exist locally in the node before Chef Solo is run.

The way you get the cookbooks there is completely up to you. You can use the SshClient to upload them, you can have them in a git repo and clone the repo when starting the node, you can provide a publicly available URL to a cookbook archive (a .tar.gz with all the cookbooks), or whatever, but cookbooks need to be in the node. You can see an example of using Chef Solo with Git in the jclouds-examples repo [2] and the cookbook archive approach in this blog post [3].

HTH!

I.

[1] http://jclouds.apache.org/guides/chef/
[2] https://github.com/jclouds/jclouds-examples/blob/master/chef-basics/src/main/java/org/apache/jclouds/examples/chef/basics/MainApp.java#L167-193
[3] http://www.abiquo.com/2012/11/12/cooking-your-own-configuration-in-the-cloud/

El 08/08/2014 16:00, "dan rusak" <me...@rseincorp.com> escribió:

Hi, 

I need the ability to use a cookbook sourced from a platform, not a remote repository. So far

all I can find are examples that use github repos or just notes that make a reference to uploading files over SshClient to

a node and running a script on that node to use that path for its cookbooks. This seems very painful and awkward.

(More so because I have yet to find a function that will upload an entire directory without resorting to

spinning through one file at a time).

Surely there must be a class/function to accept a local path instead of a repository in building the run scripts?

 

-thx

-d


Re: Utilize a local cookbook to provision a remote

Posted by Ignasi Barrera <ig...@gmail.com>.
I assume you're talking about Chef.

You can use Chef in two ways: with a Chef Server or using Chef Solo.

If you use a Chef Server, then the cookbooks and hosted there (that means
all cookbooks must be uploaded there before they can be used) and the node
will download the required ones as part of its bootstrap process. You will
find an example of using jclouds with a Chef Server in the Chef User Guide
[1].

If you don't have a Chef Server then you'll have to use Chef Solo. Chef
Solo doesn't use a Chef Server nor a "remote cookbook repository", so that
means the cookbooks must exist locally in the node before Chef Solo is run.

The way you get the cookbooks there is completely up to you. You can use
the SshClient to upload them, you can have them in a git repo and clone the
repo when starting the node, you can provide a publicly available URL to a
cookbook archive (a .tar.gz with all the cookbooks), or whatever, but
cookbooks need to be in the node. You can see an example of using Chef Solo
with Git in the jclouds-examples repo [2] and the cookbook archive approach
in this blog post [3].

HTH!

I.

[1] http://jclouds.apache.org/guides/chef/
[2]
https://github.com/jclouds/jclouds-examples/blob/master/chef-basics/src/main/java/org/apache/jclouds/examples/chef/basics/MainApp.java#L167-193
[3]
http://www.abiquo.com/2012/11/12/cooking-your-own-configuration-in-the-cloud/
El 08/08/2014 16:00, "dan rusak" <me...@rseincorp.com> escribió:

> Hi,
>
> I need the ability to use a cookbook sourced from a platform, not a remote
> repository. So far
>
> all I can find are examples that use github repos or just notes that make
> a reference to uploading files over SshClient to
>
> a node and running a script on that node to use that path for its
> cookbooks. This seems very painful and awkward.
>
> (More so because I have yet to find a function that will upload an entire
> directory without resorting to
>
> spinning through one file at a time).
>
> Surely there must be a class/function to accept a local path instead of a
> repository in building the run scripts?
>
>
>
> -thx
>
> -d
>