2

I am trying to use a custom layer in AWS Opsworks to add a nginx webserver.

I have successfully created the layer, I added my app via GIT (no password on repo), but when I deploy the command is "successful" but I don't see any of my code on my server.

In the custom layer, the only deploy recipe is "deploy::default".

Do I need a custom recipe to handle the deployment? Is this via the custom cookbook (If so, can someone please help me out with an example)

Also, how do I configure "where" the deployment goes? I'd prefer to chose my document root rather than using what location Opsworks otherwise seems to always deploy to.

Thanks for ANY help on this.

1 Answer 1

2

If you're using a Custom Layer, you basically need to configure it to use Custom Cookbooks.

We're not big on link-only answers here, but as chef cookbooks tend to be massive code chunks, and I'm pretty sure the AWS documentation is gonna be reasonably stable I'm gonna leave it as-is.

The two pages I linked to contain ample example configurations about how to use custom cookbooks. You'll need a reasonable understanding of how Chef works, though.

You should be able to configure where stuff gets deployed to as part of the recipes in your custom cookbooks, just as if you were writing your own for a non-OpsWorks deployment.

4
  • Thanks for the reply. I am still learning about chef and only have a high level understanding. I see I need to implement the custom cookbook, but any suggestions on what the proper recipe would be? Why doesn't the default deployment recipe do the trick? I just have a git repo with some PHP code in it (but would like the custom layer)
    – sudoyum
    Aug 7, 2013 at 0:44
  • I'm not very chef-savvy, really. I just tend to search github for things that might fit, and meld them to fit my use case, I suspect you might find that you can do the same. Aug 7, 2013 at 8:57
  • Thanks tom, I will keep searching. I wish I could understand why "deploy::default" won't deploy my code. In the logs: [2013-08-06T21:07:45+00:00] INFO: Processing user[deploy] action create (deploy::default line 6) [2013-08-06T21:07:45+00:00] DEBUG: Skipping user[deploy] due to not_if ruby block but theres no if "ruby" in the default deploy block
    – sudoyum
    Aug 7, 2013 at 11:07
  • Did you figure out an answer to this? I have the same problem... Aug 21, 2013 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .