Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon OpsWorks Custom Cookbooks not updating when using Load-based instances

I've deployed a stack in Amazon OpsWorks, and I extensively use custom cookbooks to deploy my application. I have a number of instances in my stack that are load-based (they only boot up when needed).

Anytime I make changes to my custom cookbooks, I have to manually update the cookbooks on any running instances (by navigating to Deployments > Run Command). The problem is that any non-booted instances are not updated, and they don't automatically update at their next boot.

I've figured out that I can delete and then recreate all my load-based instances, forcing them to be completely re-setup when they're next needed, but there must be a better way to deploy updated custom cookbooks.

How can I force my offline load-based instances to update their cookbooks at the next boot (even every boot would be fine)?

like image 231
Travis Austin Avatar asked Aug 26 '13 16:08

Travis Austin


People also ask

What language is used to create recipes AWS OpsWorks?

A recipe is a Ruby application that uses Chef's domain-specific language (DSL) to describe the final state of the instance. With AWS OpsWorks Stacks, each recipe is usually assigned to one of the layer's lifecycle events: Setup, Configuration, Deploy, Undeploy, and Shutdown.

What is custom recipe in OpsWorks?

Recipes are Ruby applications that define a system's configuration. They install packages, create configuration files from templates, execute shell commands, create files and directories, and so on.

Which configuration management tools are designed to work with AWS OpsWorks?

AWS OpsWorks is a configuration management service that provides managed instances of Chef and Puppet. Chef and Puppet are automation platforms that allow you to use code to automate the configurations of your servers.


2 Answers

From this AWS employee response on an Amazon Opsworks forum:

There isn't a way to push updates to stopped instances. We're considering ways to enable this. For now, if you create a new time or load based instance, it will get your updates.

So it would appear that for now, the only way to do what you'd like to do is to delete and recreate each of your load-based instances. This should ensure that the first time they boot up, they receive fresh versions of your custom cookbooks.

like image 176
Jeff Sisson Avatar answered Oct 30 '22 04:10

Jeff Sisson


You can run Update Custom Cookbooks command from Stack, Run Command window.

As it says: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-installingcustom-enable-update.html

enter image description here

like image 44
Kostanos Avatar answered Oct 30 '22 04:10

Kostanos