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

3

6

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)?

Filet answered 26/8, 2013 at 16:22 Comment(0)
O
2

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.

Overdo answered 27/1, 2014 at 15:58 Comment(0)
S
1

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

Satanism answered 4/11, 2015 at 1:21 Comment(0)
B
0

According to the opsworks documentation:

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

To manually update custom cookbooks

Update your repository with the modified cookbooks. AWS OpsWorks uses the cache URL that you provided when you originally installed the cookbooks, so the cookbook root file name, repository location, and access rights should not change.

For Amazon S3 or HTTP repositories, replace the original .zip file with a new .zip file that has the same name.

For Git or Subversion repositories, edit your stack settings to change the Branch/Revision field to the new version.

On the stack's page, click Run command and select the update custom cookbooks command.

Bingo answered 11/9, 2013 at 20:20 Comment(1)
From my original post: "The problem is that any non-booted instances are not updated, and they don't automatically update at their next boot." When a machine is not online when I do "On the stack's page, click Run command and select the update custom cookbooks command.", that machine is not automatically updated when it does power on. I am trying to not have to boot every machine when I do an update.Filet

© 2022 - 2024 — McMap. All rights reserved.