How do I change cookbook dynamically

Hello folks,

Scenario :

Having variables like artifacts & version with values, getting from a
run-deck job.
I need to dynamically change an existing cookbook artifacts file’s variable
values
with value getting from a run-deck job . How do I change this ?

Please suggest.

Thanks,
Mayank

why not treat them as variables? and grab them via some web api call? I
have done similar stuff where i fetched artifact/build details from
teamcity using teamcity API,

On Wed, Feb 13, 2013 at 11:17 PM, mayank verma mayank.023@gmail.com wrote:

Hello folks,

Scenario :

Having variables like artifacts & version with values, getting from a
run-deck job.
I need to dynamically change an existing cookbook artifacts file's
variable values
with value getting from a run-deck job . How do I change this ?

Please suggest.

Thanks,
Mayank

+1

I find that building an external API server that eg returns JSON, and then building a Chef library to consume that is often the easiest way to integrate with external systems.

If you make it look somewhat like a data bag, that makes it easy and flexible.

On Feb 14, 2013, at 8:20 AM, Ranjib Dey dey.ranjib@gmail.com wrote:

why not treat them as variables? and grab them via some web api call? I have done similar stuff where i fetched artifact/build details from teamcity using teamcity API,

On Wed, Feb 13, 2013 at 11:17 PM, mayank verma mayank.023@gmail.com wrote:

Hello folks,

Scenario :

Having variables like artifacts & version with values, getting from a run-deck job.
I need to dynamically change an existing cookbook artifacts file's variable values
with value getting from a run-deck job . How do I change this ?

Please suggest.

Thanks,
Mayank

@Ranjib
i already stored the values in the variables through rundeck-api, now i
want to pass those value in existing cookbook & update attribute file's
variable at runtime.

On Thu, Feb 14, 2013 at 2:53 PM, Andrea Campi
andrea.campi@zephirworks.comwrote:

+1

I find that building an external API server that eg returns JSON, and then
building a Chef library to consume that is often the easiest way to
integrate with external systems.

If you make it look somewhat like a data bag, that makes it easy and
flexible.

On Feb 14, 2013, at 8:20 AM, Ranjib Dey dey.ranjib@gmail.com wrote:

why not treat them as variables? and grab them via some web api call? I
have done similar stuff where i fetched artifact/build details from
teamcity using teamcity API,

On Wed, Feb 13, 2013 at 11:17 PM, mayank verma mayank.023@gmail.comwrote:

Hello folks,

Scenario :

Having variables like artifacts & version with values, getting from a
run-deck job.
I need to dynamically change an existing cookbook artifacts file's
variable values
with value getting from a run-deck job . How do I change this ?

Please suggest.

Thanks,
Mayank

--
Regards
Mayank Verma
mob: 7829775425
RHCE

Hi,

There is a few ways we do this. Not sure which one is the best.

For some java applications we put the binary artifacts in Nexus. We
have several different repositories (development, uat, release) and in
our chef cookbooks we "search" for the highest version artifact in
nexus. However our development chef environments searches in the
development repository, the uat chef environment searches in uat and
production/training/staging searches in the release repository. Our
"release" process often involves moving an artifact between
environments and kicking off another chef run.

Another approach is that we store the version information in databags
specific to each environment. The release process involves updating
the databag from our external tool (i.e. Jenkins) and kicking off chef
runs.

Both work well

On Thu, Feb 14, 2013 at 9:24 PM, mayank verma mayank.023@gmail.com wrote:

@Ranjib
i already stored the values in the variables through rundeck-api, now i
want to pass those value in existing cookbook & update attribute file's
variable at runtime.

On Thu, Feb 14, 2013 at 2:53 PM, Andrea Campi andrea.campi@zephirworks.com
wrote:

+1

I find that building an external API server that eg returns JSON, and then
building a Chef library to consume that is often the easiest way to
integrate with external systems.

If you make it look somewhat like a data bag, that makes it easy and
flexible.

On Feb 14, 2013, at 8:20 AM, Ranjib Dey dey.ranjib@gmail.com wrote:

why not treat them as variables? and grab them via some web api call? I
have done similar stuff where i fetched artifact/build details from teamcity
using teamcity API,

On Wed, Feb 13, 2013 at 11:17 PM, mayank verma mayank.023@gmail.com
wrote:

Hello folks,

Scenario :

Having variables like artifacts & version with values, getting from a
run-deck job.
I need to dynamically change an existing cookbook artifacts file's
variable values
with value getting from a run-deck job . How do I change this ?

Please suggest.

Thanks,
Mayank

--
Regards
Mayank Verma
mob: 7829775425
RHCE

--
Cheers,

Peter Donald