[chef] Re: how to alter a recipe in the simplest, DRYest way?


Chronological Thread 
  • From: Joshua Timberman < >
  • To:
  • Subject: [chef] Re: how to alter a recipe in the simplest, DRYest way?
  • Date: Sun, 25 Apr 2010 10:50:52 -0600

Hi Roger!

On Sun, Apr 25, 2010 at 9:41 AM, Roger Rohrbach 
< >
 wrote:
> But when I install my recipes, execute chef-client on a node that
> has nginx::source in its run list, and watch it recompile Nginx, it uses the
> default value of configure_flags.
> My next stab is to try to use a Role.  So, I create roles/web-server.rb:
>     name "web-server"
>     description "Test role for configuring Web servers"
>     recipes "nginx::source"
>     override_attributes(
>       "nginx" => {
>         "configure_flags" => [
>             "--prefix=#{nginx[:install_path]}",
>             "--conf-path=#{nginx[:dir]}/nginx.conf",
>             "--with-http_ssl_module",
>             "--with-http_gzip_static_module",
>             "--with-http_realip_module"
>         ]
>       }
>     )

A role is the best approach to this, but the role itself isn't aware
of the 'nginx' attribute when it is compiled into JSON. You should
hardset the --prefix with the install_path you want to use.

"--prefix=/opt/nginx"

Or similar.

-- 
Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.878.4322 E: 




Archive powered by MHonArc 2.6.16.

§