[chef] Re: Re: Nginx cookbook usage help


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To:
  • Subject: [chef] Re: Re: Nginx cookbook usage help
  • Date: Thu, 2 Aug 2012 05:29:25 -0700

Thanks, but I'm a bit more used to Puppet. Where can I put the actual file in Chef to push it to the node? I'd like to autoconfigure the node completely with Chef. Does that go in a databag, or a template, or?

Still trying to get bootstrapped myself :) Too bad there's know "knife-person bootstrap"...

--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")



On Thu, Aug 2, 2012 at 5:19 AM, Dan Crosta < " target="_blank"> > wrote:
On Aug 2, 2012, at 7:28 AM, Morgan Blackthorne wrote:
I've got the nginx cookbook in place now, but I'm a little fuzzy on how to proceed next. I bootstrapped a node and it configured nginx with all the defaults. I wrote my own config block which I would like to either:
  • place in /etc/nginx/sites-available
  • create a symlink to it in /etc/nginx/sites-enabled
  • disable the /etc/nginx/sites-enabled/default symlink
You can drop a file in /etc/nginx/sites-available, and then use

    nginx_site "name-of-your-file-in-sites-available" do
      enable true
    end

to have Chef enable the site for you (reloading nginx's configuration as appropriate)


Or, to just replace the default config block directly and save the hassle of mucking around with multiple files.

What's the best way to go about this?

Recent versions of the nginx cookbook have an attribute node["nginx"]["default_site_enabled"] which you can set to false to disable the default site. You can then use the above recommendation to institute your own default site. You can set this from a recipe, role, environment, etc.


- Dan





Archive powered by MHonArc 2.6.16.

§