Sha256: b04c476660ce2e0c8aaa7063044e283fdd05a6b7c4655599c955755d6da0d647

Contents?: true

Size: 1.32 KB

Versions: 47

Compression:

Stored size: 1.32 KB

Contents

#
# Cookbook Name:: apache2
# Definition:: web_app
#
# Copyright 2008, OpsCode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :web_app, :template => nil do
  
  application_name = params[:name]

  include_recipe "apache2"
  include_recipe "apache2::mod_rewrite"
  include_recipe "apache2::mod_deflate"
  include_recipe "apache2::mod_headers"
  
  template "#{node[:apache][:dir]}/sites-available/#{application_name}.conf" do
    source params[:template]
    owner "root"
    group "root"
    mode 0644
    variables(
      :application_name => application_name,
      :params => params
    )
    notifies :reload, resources(:service => "apache2"), :delayed
  end
  
  apache_site "#{params[:name]}.conf" do
    enable enable_setting
    only_if { File.exists?("#{node[:apache][:dir]}/sites-available/#{application_name}") }
  end
end

Version data entries

47 entries across 47 versions & 3 rubygems

Version Path
auser-poolparty-1.3.13 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.14 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.15 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.16 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.17 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.2 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.3 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.4 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.5 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.6 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.7 vendor/chef/apache2/definitions/web_app.rb
auser-poolparty-1.3.8 vendor/chef/apache2/definitions/web_app.rb
fairchild-poolparty-1.1.4 vendor/chef/apache2/definitions/web_app.rb
fairchild-poolparty-1.1.5 vendor/chef/apache2/definitions/web_app.rb
fairchild-poolparty-1.2.12 vendor/chef/apache2/definitions/web_app.rb
fairchild-poolparty-1.3.17 vendor/chef/apache2/definitions/web_app.rb
fairchild-poolparty-1.3.5 vendor/chef/apache2/definitions/web_app.rb
poolparty-1.3.15 vendor/chef/apache2/definitions/web_app.rb
poolparty-1.3.14 vendor/chef/apache2/definitions/web_app.rb
poolparty-1.3.13 vendor/chef/apache2/definitions/web_app.rb