chef-ingredient icon indicating copy to clipboard operation
chef-ingredient copied to clipboard

`chef_ingredient` `:upgrade`should reconfigure the service if the package version changes

Open ryancragun opened this issue 7 years ago • 2 comments

Cookbook version

2.1.5

Chef-client version

12.21.3

Platform Details

Ubuntu 16.04 on AWS

Scenario:

chef_ingredient :upgrade should reconfigure the service if the package version changes. Without this, the it's impossible to use the resource for this behavior in an idempotent way. You will either have to reconfigure every time the chef client is run or use an external resource to handle notifying the service to restart.

eg:

# not idempotent, always reconfigures
chef_ingredient "server" do
  action [:upgrade, :reconfigure]
end

# requires an external execute
execute "chef-server-ctl reconfigure" do
  action :nothing
end

chef_ingredient "server" do
  action :upgrade
  notifies :run, execute['chef-server-ctl reconfigure'], :immediately
end

cc @schisamo @sdelano

ryancragun avatar Aug 02 '17 00:08 ryancragun

Related to this, :upgrade should trigger a chef-server-ctl upgrade rather than just a reconfigure, right? I can't seem to get it to do that.

bkonick avatar Aug 31 '17 16:08 bkonick

I’m adding the Type: Jump In GitHub label to this issue. This is a great issue for someone to get their feet wet with and we’d love a PR to resolves the issue.

tas50 avatar Sep 09 '17 03:09 tas50