[chef] apache rewrite rules for apache cookbook


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] apache rewrite rules for apache cookbook
  • Date: Mon, 9 Jan 2012 07:38:16 +0100

Has anyone done any work modeling rewrite rules or ajp proxies with Chef?

Here is what I have in mind for the apache rewrite rules. Store the
individual rules in data_bags and create them using an LWRP.

data_bag/front_end_rewrites/main_page.json
{
"source": "http://www.example.com/*";,
"target": "http://backend1.example.com/";,
"flags": "P"
}

file: apache_proxy/recipes/default.rb

include_recipe "apache"
include_recipe "apache::mod_rewrite"

rules = data_bag_item('front_end_rewrites')

rules.each do |source,target,flags|
   apache_rewrite do
      source source
      target target
      flags flags
   end
end

Does anyone see any problems w/ this approach?

Since the apache cookbook currently uses definitions, should I create
a new definition for apache_rewrite or create an LWRP? I have the
impression that LWRPs are now preferred to definitions.

Modeling ajp rules would be significantly more complex than the apache
rewrite rules. I haven't put much thought into them yet.



Archive powered by MHonArc 2.6.16.

§