1
votes

Disclaimer: I'm a total AWS and especially OpsWorks noob. I am furiously reading both OpsWorks and Chef documentation in the hopes that my question is stupid/really easy.

On my app I'm using the unicorn::rails built-in OpsWorks Chef recipe. I'm pretty sure unicorn::rails builds nginx along the way using this mysterious package call in nginx/recipes/default.rb. The EC2 instance is using Ubuntu so the package manager is apt-get.

Questions:

  1. Is it possible to do custom nginx build with a built-in OpsWorks Chef recipe?
  2. If (a) is true, where does one modify the chef script to build nginx with modules?

I suspect I'll need to write a custom Chef script and add another layer to the stack. I was hoping to use the built-in recipes for as long as possible because I'm super new to AWS OpsWorks and Chef.

1
This might not be on-topic for Stack Overflow. I suspect Super User, Webmasters or Server Fault might be a better fit. - the Tin Man
thanks @theTinMan! I'll post it there. Do you know if there's a way for me to migrate a question there or should I just copy/paste? - Disaster Mouse
It can be migrated if we vote to close it for being on the wrong Stack Exchange site. That could take days. Instead, you could copy/paste the info to the other site and then delete this one. - the Tin Man

1 Answers

1
votes
  1. No.

The opsworks nginx recipe installs the nginx package:

package "nginx" 

Chef uses the local package manager to complete this task. This is most likely rpm/yum on Amazon instances.

Alternatives

If you want to use a custom nginx build I would suggest using the main nginx cookbook and it's source recipe to build and install nginx. There are node attributes that configure the build.

You could also build your own nginx rpm package and make it available to your systems then have opworks install your rpm instead of nginx with minor modifications. This may be a slippery rpm slope to ride on though.