Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7827731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:00:53+00:00 2026-06-02T10:00:53+00:00

I have a chef cookbook which installs nginx and install a custom nginx.conf file.

  • 0

I have a chef cookbook which installs nginx and install a custom nginx.conf file. It’s basically the same cookbook on Opscode, and uses cookbook_file to install the file.

If I make a change to the conf file, then rerun the cookbook using chef the configuration file isn’t updated. This seems like a bug — am I doing something wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:00:55+00:00Added an answer on June 2, 2026 at 10:00 am

    In chef that the order of commands in the recipe is the order of execution. if you kept the template for the nginx.conf and it comes after your cookbook_file command, the generated template will overwrite your file.

    e.g.

    # cookbook file
    cookbook_file "#{node[:nginx][:dir]}/nginx.conf" do
      source "my_nginx.conf"
      mode 0644
      owner "root"
      group "root"
    end
    
    # template
    template "nginx.conf" do
      path "#{node[:nginx][:dir]}/nginx.conf"
      source "nginx.conf.erb"
      owner "root"
      group "root"
      mode 0644
      notifies :reload, "service[nginx]"
    end
    

    The template would overwrite the file laid down by cookbook_file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple chef recipe which attempts to install RabbitMQ and several
I'm trying to install nginx via the opscode cookbook on Ubuntu 12.04 server. I
I have two chef recipes in my nginx cookbook. One is named default.rb and
Have deployed numerous report parts which reference the same view however one of them
I have several custom datatypes in drupal 7 restaurant menu recipe chef i want
ruby 1.9.2p290 rails 3.1.1 Basically I have two models: CHEFS and RECIPES. class Chef
I've created a chef cookbook, which has lot's of dependencies to other cookbooks. My
I am trying to configure my Vagrant file to have some chef attributes, but
Say I have the following chef role: name test description role for test run_list
Below my code for installing vcider. I am learning chef but have not seen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.