rcbops / chef-cookbooks

RCB OPS - Chef Cookbooks
Other
118 stars 102 forks source link

[horizon] Unnecessary use of chef-rewind #920

Open odyssey4me opened 10 years ago

odyssey4me commented 10 years ago

The following lines of code:

  1. https://github.com/rcbops-cookbooks/horizon/blob/master/recipes/server.rb#L30-L31
  2. https://github.com/rcbops-cookbooks/horizon/blob/master/recipes/server.rb#L58-L72

Can be replaced with simply doing something like https://github.com/rcbops-cookbooks/horizon/blob/master/recipes/server.rb#L58-L60 before line https://github.com/rcbops-cookbooks/horizon/blob/master/recipes/server.rb#L51.

This simplifies the recipe and combats the unnecessary reloads of Apache on every chef run.

mancdaz commented 10 years ago

Hi @odyssey4me

Yeah looks like we were doing the rewinds and dropping our own ports.conf template because, prior to this https://github.com/opscode-cookbooks/apache2/commit/08a20f200a30f046e50074650a6e6d0a45dd9460#diff-9a0bc5b0a917e87d68786a798af7e57b there was no way in the apache2 cookbook ports.conf template to actually specify listen IP (only ports), which we needed for haproxy/keepelived stack.

Though it shouldn't be restarting apache on every run, only when ports.conf changes.

odyssey4me commented 10 years ago

@mancdaz I've been doing quite a bit of work with the old Folsom-level cookbooks as part of a staged update process for two of our sites (Essex->Folsom->Grizzly), which is where the Apache constantly reloads. As I recall that issue was sorted out in the Grizzly-level cookbooks, which is why it's not happening any more. Working through this again just made me think that there are more elegant ways now of achieving the goal than having to use chef-rewind.

claco commented 10 years ago

Related: https://github.com/rcbops/chef-cookbooks/issues/885