Chef Nginx cookbook - override version number


#1

I have developed a cookbook for my application which depends on Nginx cookbook.
I have downloaded the Nginx cookbook from the following location

and tried including the default recipe in my cookbook and overriding version
attribute specified in the default attribute file. But irrespective of what i
do, Nginx version 1.0.x is installed. I could not track from where it is
fetching the version information. Can anyone help resolving this issue?


#2

Hello!

I’m sorry it isn’t clear, it definitely could be. There’s a lot of
attributes to drive the cookbook.

First off, there’s an install_method attribute, which defaults to
package1. This is the default, as most platforms provide an nginx
package via a repository (also configurable via attributes).

The version flag is not used in the package.rb recipe when calling the
package resource, as the versions provided by distro maintainers varies
greatly, so setting a default would probably be troublesome for most people
and hard to maintain effectively.

Alternately, you may configure which repository to be used via the
repo_source attribute 2 (if on RedHat-based platforms) to get the
Nginx-provided repo instead of EPEL.

NOTE: If nginx is already installed, the package provider will not execute,
since nginx could have been installed via source package or another method.
3

If you’re looking for a version that is not located in the repos, you may
use the the install_method = 'source' to drive the desired version to be
compiled from source and installed.

I recommend reading the some of the code and documentation to get a better
sense of how to drive the desired results.
If the documentation isn’t clear, please feel free to send a pull request!

Best,
-M

On Tue, Jul 8, 2014 at 2:42 AM, aswin88us@gmail.com wrote:

I have developed a cookbook for my application which depends on Nginx
cookbook.
I have downloaded the Nginx cookbook from the following location

https://github.com/miketheman/nginx

and tried including the default recipe in my cookbook and overriding
version
attribute specified in the default attribute file. But irrespective of
what i
do, Nginx version 1.0.x is installed. I could not track from where it is
fetching the version information. Can anyone help resolving this issue?