# Triggering chef runs/deploys:

**URL:** <https://discourse.chef.io/t/triggering-chef-runs-deploys/1510>\
**Category:** Chef Infra (archive)\
**Created:** [August 26, 2010, 5:25am UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510 "2010-08-26T05:25:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leinartas\_Michael](https://avatars.discourse-cdn.com/v4/letter/l/ac8455/32.png) [@Leinartas\_Michael](https://discourse.chef.io/u/Leinartas_Michael)\
**Post date:** [August 26, 2010, 5:25am UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/1 "2010-08-26T05:25:12Z")

</div>

So I’m at the point in my chef buildout that I need to start working on application deploys. The deploy resource is clear enough to work with. My question is, how do I trigger a deployment?

I understand that if I use the ‘revision’ deploy strategy, I can set up a branch for the production environment and trigger deploys by promoting to that branch and waiting for the next chef run, but the guys I’m working with aren’t crazy about that (and I have my hesitations as well). Right now, the only alternative I can see is to keep the deploy action disabled normally and when we want to deploy: enable deploy, ssh to all the servers and run the client, disable deploy.

So how does everyone else do this? The part of the above I really dont like is the “ssh to all the servers” part. I dont like using ssh for command and control - shell is too fragile and generic (try managing 120+ applications on 1500+ servers with nothing but ssh + scripts… bad experience), ssh key management is a pain, etc. This leads into my side question: is there some other way to trigger (push) a chef run?

FWIW the apps I’m working with right now are jruby on rails apps deployed in glassfish (using the glassfish gem) and some miscellaneous jruby daemons started with hashdot.

As usual, any insight or discussion is appreciated  
michael

---

<div class="post-metadata">

**Author:** ![Jon\_Wood](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jon_wood/32/826_2.png) [@Jon\_Wood](https://discourse.chef.io/u/Jon_Wood)\
**Post date:** [August 26, 2010, 9:52am UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/2 "2010-08-26T09:52:39Z")

</div>

On 26 August 2010 06:25, Leinartas, Michael  
[MICHAEL.LEINARTAS@orbitz.com](mailto:MICHAEL.LEINARTAS@orbitz.com) wrote:

> So I'm at the point in my chef buildout that I need to start working on  
> application deploys. The deploy resource is clear enough to work with. My  
> question is, how do I trigger a deployment?

One option would be to create a data bag for applications, and trigger  
deployments based on changes to those (possibly put the revision you  
want deployed into the data bag so that the right version hits the  
production servers). Alternatively, you might be better off using a  
different tool for application deployments if continuous deployment  
isn't something you want to do.

I'm curious as to what the problem you see with branching is though.  
As well as providing an easy place for Chef to hook into, it provides  
you with one place that everybody knows is the production code, so  
there's never any doubt as to which version is on the production  
servers.

Jon

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [August 26, 2010, 2:14pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/3 "2010-08-26T14:14:37Z")

</div>

Hello!

We wrote the 'application' cookbook to do application deployments via Chef-runs. It was originally written for a Rails application infrastructure, but it can be extended with new recipes to handle other kinds of application stacks (like jruby/glassfish, or php/drupal, python/django).

Our blog post introducing it:

> **[Data Driven Application Deployment with Chef - Chef Blog | Chef](https://www.chef.io/blog/data-driven-application-deployment-with-chef)**
>
> We are pleased to announce the release of two new cookbooks to aid in deploying applications that are designed to be completely data driven.

A recent blog post of a Chef user implementing the cookbook for his application:

> **[How to Deploy Ruby on Rails With The Opscode Chef Application Cookbook](https://agileweboperations.com/2010/08/25/how-to-deploy-ruby-on-rails-with-the-opscode-chef-application-cookbook/)**
>
> I already wrote about how to get started with the Opscode Chef Platform. In this article I want to show you a very elegant way to deploy a Ruby on Rails stack with Chef. One of the strengths of Che…

And the README documentation for the cookbook itself:

[http://github.com/opscode/cookbooks/blob/master/application/README.md](http://github.com/opscode/cookbooks/blob/master/application/README.md)

(though you should download it from the cookbooks site with knife to put it in your local chef-repo.)

That said, we don't currently have a framework in place for triggering Chef runs outside of using ssh (i.e., knife ssh). That is something we'd like to implement, and if you have ideas about it please let us know!

On Aug 25, 2010, at 11:25 PM, Leinartas, Michael wrote:

> So I'm at the point in my chef buildout that I need to start working on application deploys. The deploy resource is clear enough to work with. My question is, how do I trigger a deployment?
> 
> I understand that if I use the 'revision' deploy strategy, I can set up a branch for the production environment and trigger deploys by promoting to that branch and waiting for the next chef run, but the guys I'm working with aren't crazy about that (and I have my hesitations as well). Right now, the only alternative I can see is to keep the deploy action disabled normally and when we want to deploy: enable deploy, ssh to all the servers and run the client, disable deploy.
> 
> So how does everyone else do this? The part of the above I really dont like is the "ssh to all the servers" part. I dont like using ssh for command and control - shell is too fragile and generic (try managing 120+ applications on 1500+ servers with nothing but ssh + scripts.. bad experience), ssh key management is a pain, etc. This leads into my side question: is there some other way to trigger (push) a chef run?
> 
> FWIW the apps I'm working with right now are jruby on rails apps deployed in glassfish (using the glassfish gem) and some miscellaneous jruby daemons started with hashdot.
> 
> As usual, any insight or discussion is appreciated  
> michael

--  
Opscode, Inc  
Joshua Timberman, Technical Evangelist  
C: 720.334.RUBY E: [joshua@opscode.com](mailto:joshua@opscode.com)

---

<div class="post-metadata">

**Author:** ![Haselwanter\_Edmund](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/haselwanter_edmund/32/635_2.png) [@Haselwanter\_Edmund](https://discourse.chef.io/u/Haselwanter_Edmund)\
**Post date:** [August 26, 2010, 3:45pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/4 "2010-08-26T15:45:41Z")

</div>

On 26.08.2010, at 16:14, Joshua Timberman wrote:

> That said, we don't currently have a framework in place for triggering Chef runs outside of using ssh (i.e., knife ssh). That is something we'd like to implement, and if you have ideas about it please let us know!

isn't rightscale using nanite [GitHub - ezmobius/nanite: self assembling fabric of ruby daemons](http://github.com/ezmobius/nanite/) for command and control?

> **[GitHub - flexera-public/right\_link: RightLink: server agent for RightScale](https://github.com/flexera-public/right_link)**
>
> RightLink: server agent for RightScale . Contribute to flexera-public/right\_link development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Weiss](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jonathan_weiss/32/840_2.png) [@Jonathan\_Weiss](https://discourse.chef.io/u/Jonathan_Weiss)\
**Post date:** [August 26, 2010, 4:50pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/5 "2010-08-26T16:50:25Z")

</div>

> On 26.08.2010, at 16:14, Joshua Timberman wrote:
> 
> > That said, we don't currently have a framework in place for triggering Chef runs outside of using ssh (i.e., knife ssh). That is something we'd like to implement, and if you have ideas about it please let us know!
> 
> isn't rightscale using nanite [GitHub - ezmobius/nanite: self assembling fabric of ruby daemons](http://github.com/ezmobius/nanite/) for command and control?

At Scalarium we are using Nanite to push Chef-Solo configurations to  
every server, depending on the role and the task (deploy, first setup,  
etc.). If works fine for us while managing several hundred servers but  
has its gotchas.

Jonathan

--  
Jonathan Weiss  
[http://blog.innerewut.de](http://blog.innerewut.de)  
[http://twitter.com/jweiss](http://twitter.com/jweiss)

---

<div class="post-metadata">

**Author:** ![Haselwanter\_Edmund](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/haselwanter_edmund/32/635_2.png) [@Haselwanter\_Edmund](https://discourse.chef.io/u/Haselwanter_Edmund)\
**Post date:** [August 26, 2010, 5:27pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/6 "2010-08-26T17:27:18Z")

</div>

On 26.08.2010, at 18:50, Jonathan Weiss wrote:

> > On 26.08.2010, at 16:14, Joshua Timberman wrote:
> > 
> > > That said, we don't currently have a framework in place for triggering Chef runs outside of using ssh (i.e., knife ssh). That is something we'd like to implement, and if you have ideas about it please let us know!
> > 
> > isn't rightscale using nanite [GitHub - ezmobius/nanite: self assembling fabric of ruby daemons](http://github.com/ezmobius/nanite/) for command and control?
> 
> At Scalarium we are using Nanite to push Chef-Solo configurations to  
> every server, depending on the role and the task (deploy, first setup,  
> etc.). If works fine for us while managing several hundred servers but  
> has its gotchas.

is that any better than rsync and ssh? which i do with your webistrano 😉

cu edi

--  
DI Edmund Haselwanter, [edmund@haselwanter.com](mailto:edmund@haselwanter.com), [http://edmund.haselwanter.com/](http://edmund.haselwanter.com/)  
[http://www.iteh.at](http://www.iteh.at) | [Facebook](http://facebook.com/iTeh.solutions) | [http://at.linkedin.com/in/haselwanteredmund](http://at.linkedin.com/in/haselwanteredmund)

---

<div class="post-metadata">

**Author:** ![Jonathan\_Weiss](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jonathan_weiss/32/840_2.png) [@Jonathan\_Weiss](https://discourse.chef.io/u/Jonathan_Weiss)\
**Post date:** [August 26, 2010, 6:54pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/7 "2010-08-26T18:54:24Z")

</div>

> is that any better than rsync and ssh? which i do with your webistrano 😉

Yes as it uses RabbitMQ for communication which means that the "push"  
is async and you can react to different responses differently.  
Our backend is also all Nanite agents, so newly booted servers get  
their Chef configuration upon demand and "configure themselves"  
according to the state of the rest of the cluster and to the recipes  
that apply to their role.

Jonathan

--  
Jonathan Weiss  
[http://blog.innerewut.de](http://blog.innerewut.de)  
[http://twitter.com/jweiss](http://twitter.com/jweiss)

---

<div class="post-metadata">

**Author:** ![Leinartas\_Michael](https://avatars.discourse-cdn.com/v4/letter/l/ac8455/32.png) [@Leinartas\_Michael](https://discourse.chef.io/u/Leinartas_Michael)\
**Post date:** [August 26, 2010, 8:20pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/8 "2010-08-26T20:20:40Z")

</div>

Branching makes sense to me and I can live with it, but I come from an ops background managing java apps where we have discrete build, packaging, installation, and deploy steps so it's unfamiliar - I dont know where the traps lay and honestly, I haven't sat down and thought long and hard about our deployment cases yet. In any case, the guy's I'm working with (who have final say) want the deployment trigger to be separate, even if there is a production branch. I mean if this is the standard way of approaching the problem and I can't find any reason not to, I'll try and convince them to go this route.

Mostly though at this point I'm trying to survey what options are feasible and in current use by others in the community.

michael

On 8/26/10 4:52 AM, "Jon Wood" [jon@blankpad.net](mailto:jon@blankpad.net) wrote:

On 26 August 2010 06:25, Leinartas, Michael  
[MICHAEL.LEINARTAS@orbitz.com](mailto:MICHAEL.LEINARTAS@orbitz.com) wrote:

> So I'm at the point in my chef buildout that I need to start working on  
> application deploys. The deploy resource is clear enough to work with. My  
> question is, how do I trigger a deployment?

One option would be to create a data bag for applications, and trigger  
deployments based on changes to those (possibly put the revision you  
want deployed into the data bag so that the right version hits the  
production servers). Alternatively, you might be better off using a  
different tool for application deployments if continuous deployment  
isn't something you want to do.

I'm curious as to what the problem you see with branching is though.  
As well as providing an easy place for Chef to hook into, it provides  
you with one place that everybody knows is the production code, so  
there's never any doubt as to which version is on the production  
servers.

Jon

---

<div class="post-metadata">

**Author:** ![Leinartas\_Michael](https://avatars.discourse-cdn.com/v4/letter/l/ac8455/32.png) [@Leinartas\_Michael](https://discourse.chef.io/u/Leinartas_Michael)\
**Post date:** [August 26, 2010, 8:40pm UTC](https://discourse.chef.io/t/triggering-chef-runs-deploys/1510/9 "2010-08-26T20:40:58Z")

</div>

I saw mention of nanite in a presentation I watched when I was first checking out chef a couple months back but hadn't seen any mention since then. The project looks neat and I'd like to check it out, though with my current timeline I may end up opting for an ssh trigger and changing it out later.

Are you aware of anything out there that builds on nanite? That is, existing chef integration or something that'd give me a head start for some simple remote executions. The examples included in the project look like they illustrate a lot of the potential, but the reason I shied away from it in the first place is because it looks like a decent investment in time and thinking and I'm currently putting all that bandwidth to use getting everything added to Chef.

Thanks, good to know this is a potential option  
michael

On 8/26/10 1:54 PM, "Jonathan Weiss" [jw@innerewut.de](mailto:jw@innerewut.de) wrote:

> is that any better than rsync and ssh? which i do with your webistrano 😉

Yes as it uses RabbitMQ for communication which means that the "push"  
is async and you can react to different responses differently.  
Our backend is also all Nanite agents, so newly booted servers get  
their Chef configuration upon demand and "configure themselves"  
according to the state of the rest of the cluster and to the recipes  
that apply to their role.

Jonathan

--  
Jonathan Weiss  
[http://blog.innerewut.de](http://blog.innerewut.de)  
[http://twitter.com/jweiss](http://twitter.com/jweiss)
