├── fssle_wiki
├── Practice
│ ├── CI.md
│ └── Agile.md
├── Tools
│ └── MacOSx.md
├── Articles
│ ├── Android.md
│ ├── Ruby.md
│ ├── iOS.md
│ └── Python.md
├── README
├── Gemfile
├── _Footer.md
├── Slides
│ └── iPhoneRestore.pdf
├── About.md
├── _Sidebar.md
├── config.ru
├── Home.md
└── Gemfile.lock
├── .rvmrc
├── .gitignore
├── vagrant_demo
├── .vagrant
├── README
└── Vagrantfile
├── fssle_api
├── roles
│ ├── base.rb
│ └── fssle.rb
├── cookbooks
│ ├── fssle
│ │ ├── templates
│ │ │ └── default
│ │ │ │ ├── fssle-apt-source.erb
│ │ │ │ ├── lenny-backports.erb
│ │ │ │ ├── config.ru.erb
│ │ │ │ ├── mywiki.conf.erb
│ │ │ │ └── myproj.conf.erb
│ │ ├── recipes
│ │ │ ├── fssle_web.rb
│ │ │ ├── fssle_aws.rb
│ │ │ ├── fssle_users.rb
│ │ │ ├── default.rb
│ │ │ ├── essential.rb
│ │ │ ├── fssle_myproj.rb
│ │ │ ├── repository.rb
│ │ │ ├── fssle_rvm.rb
│ │ │ └── fssle_mywiki.rb
│ │ ├── attributes
│ │ │ └── default.rb
│ │ └── metadata.rb
│ ├── apache2
│ │ ├── templates
│ │ │ └── default
│ │ │ │ ├── port_apache.erb
│ │ │ │ ├── mods
│ │ │ │ ├── authopenid.load.erb
│ │ │ │ ├── README
│ │ │ │ ├── dir.conf.erb
│ │ │ │ ├── fcgid.conf.erb
│ │ │ │ ├── status.conf.erb
│ │ │ │ ├── php5.conf.erb
│ │ │ │ ├── proxy.conf.erb
│ │ │ │ ├── negotiation.conf.erb
│ │ │ │ ├── deflate.conf.erb
│ │ │ │ ├── alias.conf.erb
│ │ │ │ ├── setenvif.conf.erb
│ │ │ │ ├── ssl.conf.erb
│ │ │ │ ├── autoindex.conf.erb
│ │ │ │ └── mime.conf.erb
│ │ │ │ ├── ports.conf.erb
│ │ │ │ ├── mod_auth_openid.rb.erb
│ │ │ │ ├── charset.erb
│ │ │ │ ├── apache2.god.erb
│ │ │ │ ├── a2dismod.erb
│ │ │ │ ├── a2dissite.erb
│ │ │ │ ├── a2ensite.erb
│ │ │ │ ├── a2enmod.erb
│ │ │ │ ├── web_app.conf.erb
│ │ │ │ ├── security.erb
│ │ │ │ ├── default-site.erb
│ │ │ │ └── apache2.conf.erb
│ │ ├── recipes
│ │ │ ├── mod_dav_fs.rb
│ │ │ ├── mod_cgi.rb
│ │ │ ├── mod_dav.rb
│ │ │ ├── mod_env.rb
│ │ │ ├── mod_ldap.rb
│ │ │ ├── mod_expires.rb
│ │ │ ├── mod_headers.rb
│ │ │ ├── mod_proxy_ajp.rb
│ │ │ ├── mod_rewrite.rb
│ │ │ ├── mod_auth_basic.rb
│ │ │ ├── mod_auth_digest.rb
│ │ │ ├── mod_authn_file.rb
│ │ │ ├── mod_authnz_ldap.rb
│ │ │ ├── mod_authz_host.rb
│ │ │ ├── mod_authz_user.rb
│ │ │ ├── mod_proxy_balancer.rb
│ │ │ ├── mod_proxy_connect.rb
│ │ │ ├── mod_proxy_http.rb
│ │ │ ├── mod_authz_default.rb
│ │ │ ├── mod_dir.rb
│ │ │ ├── mod_mime.rb
│ │ │ ├── mod_alias.rb
│ │ │ ├── mod_authz_groupfile.rb
│ │ │ ├── mod_proxy.rb
│ │ │ ├── mod_status.rb
│ │ │ ├── mod_deflate.rb
│ │ │ ├── mod_setenvif.rb
│ │ │ ├── mod_autoindex.rb
│ │ │ ├── mod_negotiation.rb
│ │ │ ├── mod_log_config.rb
│ │ │ ├── mod_wsgi.rb
│ │ │ ├── mod_xsendfile.rb
│ │ │ ├── mod_dav_svn.rb
│ │ │ ├── mod_python.rb
│ │ │ ├── god_monitor.rb
│ │ │ ├── mod_ssl.rb
│ │ │ ├── mod_fcgid.rb
│ │ │ ├── mod_php5.rb
│ │ │ ├── mod_auth_openid.rb
│ │ │ └── default.rb
│ │ ├── definitions
│ │ │ ├── apache_conf.rb
│ │ │ ├── web_app.rb
│ │ │ ├── apache_site.rb
│ │ │ └── apache_module.rb
│ │ ├── files
│ │ │ └── default
│ │ │ │ └── apache2_module_conf_generate.pl
│ │ ├── attributes
│ │ │ └── default.rb
│ │ └── metadata.rb
│ ├── passenger_apache2
│ │ ├── templates
│ │ │ └── default
│ │ │ │ ├── passenger.load.erb
│ │ │ │ ├── passenger.conf.erb
│ │ │ │ ├── passenger_web_app.conf.erb
│ │ │ │ └── web_app.conf.erb
│ │ ├── attributes
│ │ │ └── default.rb
│ │ ├── metadata.rb
│ │ ├── recipes
│ │ │ ├── mod_rails.rb
│ │ │ └── default.rb
│ │ ├── README.md
│ │ └── metadata.json
│ ├── aws
│ │ ├── resources
│ │ │ ├── elastic_ip.rb
│ │ │ └── ebs_volume.rb
│ │ ├── metadata.rb
│ │ ├── recipes
│ │ │ └── default.rb
│ │ ├── libraries
│ │ │ └── ec2.rb
│ │ ├── providers
│ │ │ └── elastic_ip.rb
│ │ ├── metadata.json
│ │ └── README.md
│ ├── apt
│ │ ├── files
│ │ │ └── default
│ │ │ │ ├── apt-cacher
│ │ │ │ ├── apt-proxy-v2.conf
│ │ │ │ └── apt-cacher.conf
│ │ ├── metadata.rb
│ │ ├── resources
│ │ │ └── repository.rb
│ │ ├── recipes
│ │ │ ├── cacher.rb
│ │ │ ├── cacher-client.rb
│ │ │ └── default.rb
│ │ ├── providers
│ │ │ └── repository.rb
│ │ ├── README.md
│ │ └── metadata.json
│ └── build-essential
│ │ ├── metadata.rb
│ │ ├── metadata.json
│ │ ├── README.md
│ │ └── recipes
│ │ └── default.rb
├── .chef
│ └── knife.rb
├── definitions
│ └── fssle
│ │ ├── definition.rb
│ │ ├── postinstall.sh
│ │ └── preseed.cfg
├── README
└── StepByStep.markdown
└── README
/fssle_wiki/Practice/CI.md:
--------------------------------------------------------------------------------
1 | ## Chef
--------------------------------------------------------------------------------
/fssle_wiki/Tools/MacOSx.md:
--------------------------------------------------------------------------------
1 | ## Brew
--------------------------------------------------------------------------------
/.rvmrc:
--------------------------------------------------------------------------------
1 | rvm --create use 1.9.2@chef
2 |
--------------------------------------------------------------------------------
/fssle_wiki/Articles/Android.md:
--------------------------------------------------------------------------------
1 | ## NDK
--------------------------------------------------------------------------------
/fssle_wiki/Articles/Ruby.md:
--------------------------------------------------------------------------------
1 | ## RVM
2 |
--------------------------------------------------------------------------------
/fssle_wiki/Articles/iOS.md:
--------------------------------------------------------------------------------
1 | ## Three20
--------------------------------------------------------------------------------
/fssle_wiki/README:
--------------------------------------------------------------------------------
1 | [4SsLe](http://wiki.fssle.com)
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | *.pem
3 | *.box
4 | iso/
5 | *.tar.gz
6 |
--------------------------------------------------------------------------------
/fssle_wiki/Articles/Python.md:
--------------------------------------------------------------------------------
1 | ## PyPy
2 |
3 | ## Pip
4 |
5 | ## VirtualEnv
--------------------------------------------------------------------------------
/fssle_wiki/Gemfile:
--------------------------------------------------------------------------------
1 | source :rubygems
2 |
3 | gem 'gollum'
4 | gem 'rdiscount'
--------------------------------------------------------------------------------
/fssle_wiki/_Footer.md:
--------------------------------------------------------------------------------
1 | Thanks
2 |
3 | [gollum](https://github.com/github/gollum)
--------------------------------------------------------------------------------
/vagrant_demo/.vagrant:
--------------------------------------------------------------------------------
1 | {"active":{"default":"1aa4fd06-8ccb-4944-80ee-a683589f870c"}}
--------------------------------------------------------------------------------
/fssle_wiki/Practice/Agile.md:
--------------------------------------------------------------------------------
1 | ## TDD
2 |
3 | [[Rspec]]
4 |
5 | ## BDD
6 |
7 | [[Cucumber]]
8 |
--------------------------------------------------------------------------------
/fssle_api/roles/base.rb:
--------------------------------------------------------------------------------
1 | name "base"
2 | description "Base Fssle node"
3 | run_list "recipe[apt]"
4 |
5 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/templates/default/fssle-apt-source.erb:
--------------------------------------------------------------------------------
1 | deb <%=node.fssle.apt.source%>/ lenny rea backports
2 |
--------------------------------------------------------------------------------
/fssle_wiki/Slides/iPhoneRestore.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lite/fssle_ec2/master/fssle_wiki/Slides/iPhoneRestore.pdf
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/port_apache.erb:
--------------------------------------------------------------------------------
1 | # Port <%= @port %>
2 | -A FWR -p tcp -m tcp --dport <%= @port %> -j ACCEPT
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/templates/default/lenny-backports.erb:
--------------------------------------------------------------------------------
1 | deb http://backports.debian.org/debian-backports lenny-backports main
2 |
--------------------------------------------------------------------------------
/fssle_api/roles/fssle.rb:
--------------------------------------------------------------------------------
1 | name "fssle"
2 | description "An Fssle-API application server."
3 | run_list "role[base]", "recipe[fssle]"
4 |
5 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/templates/default/passenger.load.erb:
--------------------------------------------------------------------------------
1 | LoadModule passenger_module <%= node[:passenger][:module_path] %>
2 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/authopenid.load.erb:
--------------------------------------------------------------------------------
1 | LoadModule authopenid_module <%= node[:apache][:lib_dir] %>/modules/mod_auth_openid.so
2 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/README:
--------------------------------------------------------------------------------
1 | These configs are taken from a Debian apache2.2-common 2.2.11-3 install. They
2 | work on CentOS 5.3 with a few conditions using erb.
3 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/dir.conf.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
4 |
5 |
6 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/fssle_web.rb:
--------------------------------------------------------------------------------
1 | include_recipe "apache2"
2 | include_recipe "apache2::mod_ssl"
3 | include_recipe "apache2::mod_rewrite"
4 | include_recipe "passenger_apache2::mod_rails"
5 |
6 |
--------------------------------------------------------------------------------
/fssle_wiki/About.md:
--------------------------------------------------------------------------------
1 | ID: __Lite__
2 |
3 | @:
4 |
5 | [GitHub](http://github.com/lite)
6 |
7 | Worked at [FD](http://www.futuredial.com)
8 |
9 | Now is [TW](http://www.thouhghtworks.com)
10 |
11 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/ports.conf.erb:
--------------------------------------------------------------------------------
1 | #This file generated via template by Chef.
2 | <% @apache_listen_ports.each do |port| -%>
3 | Listen <%= port %>
4 | NameVirtualHost *:<%= port %>
5 |
6 | <% end -%>
7 |
--------------------------------------------------------------------------------
/fssle_wiki/_Sidebar.md:
--------------------------------------------------------------------------------
1 | #[[Home]]
2 |
3 | ## Articles
4 |
5 | * [[iOS]]
6 | * [[Android]]
7 | * [[Ruby]]
8 | * [[Python]]
9 |
10 | ## Tools
11 |
12 | * [[MacOSx]]
13 |
14 | ## Practice
15 |
16 | * [[Agile]]
17 | * [[CI]]
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/fssle_aws.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: fssle
3 | # Recipe:: default
4 | #
5 | # Copyright 2011, YOUR_COMPANY_NAME
6 | #
7 | # All rights reserved - Do Not Redistribute
8 | #
9 | require_recipe "aws"
10 |
11 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/templates/default/passenger.conf.erb:
--------------------------------------------------------------------------------
1 | PassengerRoot <%= node[:passenger][:root_path] %>
2 | PassengerRuby <%= node[:languages][:ruby][:ruby_bin] %>
3 | PassengerMaxPoolSize <%= node[:passenger][:max_pool_size] %>
4 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | # chef-server on ec2
2 |
3 | ssh -i fssle-ec2.pem ec2-user@www.fssle.com
4 | sudo bash -c 'bash <(curl -sLB https://raw.github.com/gist/1209226/bootstrap_chef_server.sh) --hostname www.fssle.com'
5 |
6 | # gollum on ec2 by chef
7 |
8 |
9 |
--------------------------------------------------------------------------------
/fssle_wiki/config.ru:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'bundler'
3 |
4 | Bundler.require
5 |
6 | require "gollum/frontend/app"
7 |
8 | Precious::App.set(:gollum_path, File.expand_path(File.dirname(__FILE__)))
9 | Precious::App.set(:wiki_options, {})
10 | run Precious::App
11 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/templates/default/config.ru.erb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'bundler'
3 |
4 | Bundler.require
5 |
6 | require "gollum/frontend/app"
7 |
8 | Precious::App.set(:gollum_path, File.expand_path(File.dirname(__FILE__)))
9 | Precious::App.set(:wiki_options, {})
10 | run Precious::App
11 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mod_auth_openid.rb.erb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | allowed_openids = Array.new
4 | <% node[:apache][:allowed_openids].each do |id| -%>
5 | allowed_openids << "<%= id %>"
6 | <% end -%>
7 |
8 | if allowed_openids.grep(ARGV[0]).length > 0
9 | exit 0
10 | else
11 | exit 1
12 | end
13 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/charset.erb:
--------------------------------------------------------------------------------
1 | # Read the documentation before enabling AddDefaultCharset.
2 | # In general, it is only a good idea if you know that all your files
3 | # have this encoding. It will override any encoding given in the files
4 | # in meta http-equiv or xml encoding tags.
5 |
6 | #AddDefaultCharset UTF-8
7 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/resources/elastic_ip.rb:
--------------------------------------------------------------------------------
1 | actions :associate, :disassociate
2 |
3 | attribute :aws_access_key, :kind_of => String
4 | attribute :aws_secret_access_key, :kind_of => String
5 | attribute :ip, :kind_of => String
6 | attribute :timeout, :default => 3*60 # 3 mins, nil or 0 for no timeout
7 |
--------------------------------------------------------------------------------
/fssle_wiki/Home.md:
--------------------------------------------------------------------------------
1 | "For Super simplicity & Life easier"
2 |
3 | ## Articles
4 |
5 | [[iOS]]
6 | [[Android]]
7 | [[Ruby]]
8 | [[Python]]
9 |
10 | ## Tools
11 |
12 | [[MacOSx]]
13 |
14 | ## Practice
15 |
16 | [[Agile]]
17 | [[CI]]
18 |
19 | ## Slides
20 |
21 | [[iPhone Restore|/Slides/iPhoneRestore.pdf]]
22 |
23 | ## [[About]]
24 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/attributes/default.rb:
--------------------------------------------------------------------------------
1 | default[:fssle][:repository] = "http://dist/"
2 | default[:fssle][:apt][:source] = "#{node[:fssle][:repository]}/debian"
3 | default[:fssle][:gem][:source] = "#{node[:fssle][:repository]}/rubygems"
4 |
5 | default[:fssle][:apps][:dir] = "/opt/fssle/apps"
6 | default[:fssle][:conf][:dir] = "/opt/fssle/conf"
7 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/attributes/default.rb:
--------------------------------------------------------------------------------
1 | default[:passenger][:version] = "3.0.7"
2 | default[:passenger][:max_pool_size] = "6"
3 | default[:passenger][:root_path] = "#{languages[:ruby][:gems_dir]}/gems/passenger-#{passenger[:version]}"
4 | default[:passenger][:module_path] = "#{passenger[:root_path]}/ext/apache2/mod_passenger.so"
5 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/files/default/apt-cacher:
--------------------------------------------------------------------------------
1 | # apt-cacher startup configuration file
2 |
3 | # IMPORTANT: check the apt-cacher.conf file before using apt-cacher as daemon.
4 |
5 | # set to 1 to start the daemon at boot time
6 | AUTOSTART=1
7 |
8 | # extra settings to override the ones in apt-cacher.conf
9 | # EXTRAOPT=" daemon_port=3142 limit=30 "
10 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/templates/default/mywiki.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | ServerName <%= @params[:server_name] %>
3 | DocumentRoot <%= @params[:docroot] %>
4 |
5 | RackEnv development
6 | RackBaseURI /
7 | >
8 | Allow from all
9 | Options -MultiViews
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "Opscode, Inc."
2 | maintainer_email "cookbooks@opscode.com"
3 | license "Apache 2.0"
4 | description "LWRPs for managing AWS resources"
5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6 | version "0.99.0"
7 | recipe "aws", "Installs the right_aws gem during compile time"
8 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/fcgid.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | AddHandler fcgid-script .fcgi
3 | IPCConnectTimeout 20
4 |
5 |
6 | <% if %w{ redhat centos scientific fedora }.include?(node[:platform]) -%>
7 | # Sane place to put sockets and shared memory file
8 | SocketPath run/mod_fcgid
9 | SharememPath run/mod_fcgid/fcgid_shm
10 | <% end -%>
11 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "lite"
2 | maintainer_email "litekok@gmail.com"
3 | description "Installs/Configures Fssle"
4 |
5 | recipe "fssle", "Installs Fssle"
6 |
7 | depends "apt"
8 | depends "aws"
9 | depends "build-essential"
10 | depends "apache2"
11 | depends "passenger_apache2"
12 |
13 | %w{ redhat centos ubuntu debian }.each do |os|
14 | supports os
15 | end
16 |
17 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/build-essential/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "Opscode, Inc."
2 | maintainer_email "cookbooks@opscode.com"
3 | license "Apache 2.0"
4 | description "Installs C compiler / build tools"
5 | version "1.0.0"
6 | recipe "build-essential", "Installs C compiler and build tools on Linux"
7 |
8 | %w{ fedora redhat centos ubuntu debian }.each do |os|
9 | supports os
10 | end
11 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/fssle_users.rb:
--------------------------------------------------------------------------------
1 | user "fssle" do
2 | comment "Fssle User"
3 | system true
4 | home "/opt/fssle"
5 | shell "/bin/bash"
6 | supports :manage_home => true
7 | end
8 |
9 | execute "add local gem environment" do
10 | command "echo -e 'GEM_HOME=$HOME/.gem export GEM_HOME\nPATH=$PATH:$GEM_HOME/bin export PATH' >> /opt/fssle/.bash_profile"
11 | not_if "grep GEM_HOME /opt/fssle/.bash_profile"
12 | end
13 |
14 |
15 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/default.rb:
--------------------------------------------------------------------------------
1 | # Cookbook Name:: fssle
2 | # Recipe:: default
3 | #
4 | # Copyright 2011, Fssle
5 | #
6 | # All rights reserved - Do Not Redistribute
7 | #
8 | require_recipe "fssle::essential"
9 | require_recipe "fssle::fssle_aws"
10 | require_recipe "fssle::repository"
11 | require_recipe "fssle::fssle_rvm"
12 | # require_recipe "fssle::fssle_myproj"
13 | require_recipe "fssle::fssle_web"
14 | require_recipe "fssle::fssle_mywiki"
15 |
16 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/status.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Allow server status reports generated by mod_status,
4 | # with the URL of http://servername/server-status
5 | # Uncomment and change the ".example.com" to allow
6 | # access from other hosts.
7 | #
8 |
9 | SetHandler server-status
10 | Order deny,allow
11 | Deny from all
12 | Allow from localhost ip6-localhost
13 | # Allow from .example.com
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/essential.rb:
--------------------------------------------------------------------------------
1 | package "less"
2 | package "screen"
3 | package "sudo"
4 | package "zip"
5 | package "unzip"
6 |
7 | case node[:platform]
8 | when "ubuntu","debian"
9 | package "dnsutils" do
10 | action :install
11 | end
12 | #package "vim-scripts"
13 | package "strace"
14 | package "ltrace"
15 | package "lsof"
16 | package "lslk"
17 | package "netcat"
18 | package "telnet"
19 | package "tcpdump"
20 | end
21 |
22 | directory '/var/empty' do
23 | action :create
24 | mode '0555'
25 | end
26 |
27 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/fssle_myproj.rb:
--------------------------------------------------------------------------------
1 | # This recipe installs the rea-env gem for the
2 | # fssle user.
3 |
4 | gem_package "rails"
5 |
6 | bash "new myproj" do
7 | user "root"
8 | cwd "/tmp"
9 | code <<-EOH
10 | rails new myproj
11 | cd myproj
12 | bundle install
13 | EOH
14 | end
15 |
16 | web_app 'myproj' do
17 | docroot "/tmp/myproj/public"
18 | template "myproj.conf.erb"
19 | server_name "www.fssle.com"
20 | rails_env "production"
21 | end
22 |
23 | apache_site "000-default" do
24 | enable false
25 | end
26 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/apache2.god.erb:
--------------------------------------------------------------------------------
1 | God.watch do |w|
2 | w.name = "apache2"
3 | w.interval = 30.seconds # default
4 | w.start = "<%= @params[:start] %>"
5 | w.stop = "/etc/init.d/httpd stop"
6 | w.restart = "<%= @params[:restart] %>"
7 | w.start_grace = 10.seconds
8 | w.restart_grace = 10.seconds
9 | w.pid_file = "/var/run/httpd.pid"
10 | w.behavior(:clean_pid_file)
11 |
12 | w.start_if do |start|
13 | start.condition(:process_running) do |c|
14 | c.interval = 5.seconds
15 | c.running = false
16 | c.notify = 'admin'
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/resources/ebs_volume.rb:
--------------------------------------------------------------------------------
1 | actions :create, :attach, :detach, :snapshot, :prune
2 |
3 | attribute :aws_access_key, :kind_of => String
4 | attribute :aws_secret_access_key, :kind_of => String
5 | attribute :size, :kind_of => Integer
6 | attribute :snapshot_id, :kind_of => String
7 | attribute :availability_zone, :kind_of => String
8 | attribute :device, :kind_of => String
9 | attribute :volume_id, :kind_of => String
10 | attribute :timeout, :default => 3*60 # 3 mins, nil or 0 for no timeout
11 | attribute :snapshots_to_keep, :default => 2
12 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "Opscode, Inc."
2 | maintainer_email "cookbooks@opscode.com"
3 | license "Apache 2.0"
4 | description "Installs passenger for Apache2"
5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6 | version "0.99.0"
7 |
8 | recipe "passenger_apache2", "Installs Passenger as an Apache module"
9 | recipe "passenger_apache2::mod_rails", "Enables Apache module configuration for passenger module"
10 |
11 | depends "apache2"
12 | depends "build-essential"
13 |
14 | %w{ redhat centos ubuntu debian }.each do |os|
15 | supports os
16 | end
17 |
--------------------------------------------------------------------------------
/vagrant_demo/README:
--------------------------------------------------------------------------------
1 | * vagrant
2 | http://vagrantup.com
3 |
4 | * veewee
5 | https://github.com/jedi4ever/veewee
6 | vagrant basebox templates`
7 | mkdir iso
8 | vagrant basebox define 'fssle' 'ubuntu-11.04-server-i386'
9 | vagrant basebox build 'fssle'
10 | vagrant basebox validate 'fssle'
11 | vagrant basebox export 'fssle'
12 | vagrant box add 'fssle' 'fssle'
13 | vagrant init 'fssle'
14 | vagrant up
15 | vagrant reload
16 | vagrant ssh
17 |
18 | * GUI
19 | username: vagrant
20 | password: vagrant
21 |
22 | sudo chef-solo -c /tmp/vagrant-chef/solo.rb -j /tmp/vagrant-chef/dna.json -l debug
23 | vagrant provision
24 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "Opscode, Inc."
2 | maintainer_email "cookbooks@opscode.com"
3 | license "Apache 2.0"
4 | description "Configures apt and apt services and an LWRP for managing apt repositories"
5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6 | version "1.2.0"
7 | recipe "apt", "Runs apt-get update during compile phase and sets up preseed directories"
8 | recipe "apt::cacher", "Set up an APT cache"
9 | recipe "apt::cacher-client", "Client for the apt::cacher server"
10 |
11 | %w{ ubuntu debian }.each do |os|
12 | supports os
13 | end
14 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/php5.conf.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | SetHandler application/x-httpd-php
4 |
5 |
6 | SetHandler application/x-httpd-php-source
7 |
8 | # To re-enable php in user directories comment the following lines
9 | # (from to .) Do NOT set it to On as it
10 | # prevents .htaccess files from disabling it.
11 |
12 |
13 | php_admin_value engine Off
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/proxy.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | #turning ProxyRequests on and allowing proxying from all may allow
3 | #spammers to use your proxy to send email.
4 |
5 | ProxyRequests Off
6 |
7 |
8 | AddDefaultCharset off
9 | Order deny,allow
10 | Deny from all
11 | #Allow from .example.com
12 |
13 |
14 | # Enable/disable the handling of HTTP/1.1 "Via:" headers.
15 | # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
16 | # Set to one of: Off | On | Full | Block
17 |
18 | ProxyVia On
19 |
20 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/repository.rb:
--------------------------------------------------------------------------------
1 | if platform?("debian")
2 |
3 | #execute "wget -O - #{node.fssle.apt.source}/dists/archive.key | apt-key add -" do
4 | # not_if "apt-key list | grep 'Fssle'"
5 | #end
6 |
7 | include_recipe "apt"
8 |
9 | template "/etc/apt/sources.list.d/backports.list" do
10 | source "lenny-backports.erb"
11 | mode 0644
12 | owner "root"
13 | group "root"
14 | notifies :run, resources(:execute => "apt-get update"), :immediately
15 | end
16 |
17 | template "/etc/apt/sources.list.d/fssle.list" do
18 | source "fssle-apt-source.erb"
19 | mode 0644
20 | owner "root"
21 | group "root"
22 | notifies :run, resources(:execute => "apt-get update"), :immediately
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_dav_fs.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: dav_fs
4 | #
5 | # Copyright 2011, Atriso
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "dav_fs"
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/a2dismod.erb:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | SYSCONFDIR='<%= node[:apache][:dir] %>'
4 |
5 | if [ -z $1 ]; then
6 | echo "Which module would you like to disable?"
7 | echo -n "Your choices are: "
8 | ls $SYSCONFDIR/mods-enabled/*.load | \
9 | sed -e "s,$SYSCONFDIR/mods-enabled/,,g" | sed -e 's/\.load$//g;' | xargs echo
10 | echo -n "Module name? "
11 | read MODNAME
12 | else
13 | MODNAME=$1
14 | fi
15 |
16 | if ! [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load ]; then
17 | echo "This module is already disabled, or does not exist!"
18 | exit 1
19 | fi
20 |
21 | rm -f $SYSCONFDIR/mods-enabled/$MODNAME.*
22 | echo "Module $MODNAME disabled; reload apache to fully disable."
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_cgi.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: cgi
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "cgi"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_dav.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: dav
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "dav"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_env.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: env
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "env"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_ldap.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: ldap
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "ldap"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_expires.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: expires
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "expires"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_headers.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: headers
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "headers"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_proxy_ajp.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: proxy
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "proxy_ajp"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_rewrite.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: rewrite
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "rewrite"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_auth_basic.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: auth_basic
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "auth_basic"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_auth_digest.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: auth_digest
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "auth_digest"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_authn_file.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: authn_file
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "authn_file"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_authnz_ldap.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: authnz_ldap
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "authnz_ldap"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_authz_host.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: authz_host
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "authz_host"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_authz_user.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: authz_user
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "authz_user"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_proxy_balancer.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: proxy
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "proxy_balancer"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_proxy_connect.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: proxy
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "proxy_connect"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_proxy_http.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: proxy_http
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "proxy_http"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/negotiation.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # LanguagePriority allows you to give precedence to some languages
4 | # in case of a tie during content negotiation.
5 | #
6 | # Just list the languages in decreasing order of preference. We have
7 | # more or less alphabetized them here. You probably want to change this.
8 | #
9 | LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW
10 |
11 | #
12 | # ForceLanguagePriority allows you to serve a result page rather than
13 | # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
14 | # [in case no accepted languages matched the available variants]
15 | #
16 | ForceLanguagePriority Prefer Fallback
17 |
18 |
19 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_authz_default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: authz_default
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "authz_default"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_dir.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: dir
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "dir" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_mime.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: mime
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "mime" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_alias.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: alias
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "alias" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_authz_groupfile.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: authz_groupfile
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "authz_groupfile"
21 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_proxy.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: proxy
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "proxy" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_status.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: status
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "status" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_deflate.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: deflate
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "deflate" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_setenvif.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: setenvif
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "setenvif" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_autoindex.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: autoindex
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "autoindex" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_negotiation.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: negotiation
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_module "negotiation" do
21 | conf true
22 | end
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/build-essential/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "build-essential",
3 | "description": "Installs C compiler / build tools",
4 | "long_description": "",
5 | "maintainer": "Opscode, Inc.",
6 | "maintainer_email": "cookbooks@opscode.com",
7 | "license": "Apache 2.0",
8 | "platforms": {
9 | "fedora": ">= 0.0.0",
10 | "redhat": ">= 0.0.0",
11 | "centos": ">= 0.0.0",
12 | "ubuntu": ">= 0.0.0",
13 | "debian": ">= 0.0.0"
14 | },
15 | "dependencies": {
16 | },
17 | "recommendations": {
18 | },
19 | "suggestions": {
20 | },
21 | "conflicting": {
22 | },
23 | "providing": {
24 | },
25 | "replacing": {
26 | },
27 | "attributes": {
28 | },
29 | "groupings": {
30 | },
31 | "recipes": {
32 | "build-essential": "Installs C compiler and build tools on Linux"
33 | },
34 | "version": "1.0.0"
35 | }
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/templates/default/myproj.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | ServerName <%= @params[:server_name] %>
3 | DocumentRoot <%= @params[:docroot] %>
4 |
5 | RailsBaseURI /
6 | RailsEnv production
7 | RailsAllowModRewrite on
8 |
9 | >
10 | Options FollowSymLinks
11 | AllowOverride None
12 | Order allow,deny
13 | Allow from all
14 |
15 |
16 | LogLevel info
17 |
18 | RewriteEngine On
19 | RewriteLogLevel 0
20 | # Canonical host
21 | RewriteCond %{HTTP_HOST} !^<%= @params[:server_name] %> [NC]
22 | RewriteCond %{HTTP_HOST} !^$
23 | RewriteRule ^/(.*)$ http://<%= @params[:server_name] %>/$1 [L,R=301]
24 |
25 | RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
26 | RewriteCond %{SCRIPT_FILENAME} !maintenance.html
27 | RewriteRule ^.*$ /system/maintenance.html [L]
28 |
29 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/recipes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: aws
3 | # Recipe:: default
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | r = gem_package "right_aws" do
21 | action :nothing
22 | end
23 |
24 | r.run_action(:install)
25 |
26 | require 'rubygems'
27 | Gem.clear_paths
28 | require 'right_aws'
29 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_log_config.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: log_config
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | if platform?("redhat", "centos", "scientific", "fedora", "suse", "arch")
21 | apache_module "log_config"
22 | else
23 | include_recipe "apache2"
24 | end
25 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/build-essential/README.md:
--------------------------------------------------------------------------------
1 | DESCRIPTION
2 | ===========
3 |
4 | Installs packages required for compiling C software from source.
5 |
6 | LICENSE AND AUTHOR
7 | ==================
8 |
9 | Author:: Joshua Timberman ()
10 | Author:: Seth Chisamore ()
11 |
12 | Copyright 2009-2011, Opscode, Inc.
13 |
14 | Licensed under the Apache License, Version 2.0 (the "License");
15 | you may not use this file except in compliance with the License.
16 | You may obtain a copy of the License at
17 |
18 | http://www.apache.org/licenses/LICENSE-2.0
19 |
20 | Unless required by applicable law or agreed to in writing, software
21 | distributed under the License is distributed on an "AS IS" BASIS,
22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | See the License for the specific language governing permissions and
24 | limitations under the License.
25 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_wsgi.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: python
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | case node[:platform]
21 | when "debian","ubuntu"
22 | package "libapache2-mod-wsgi"
23 | when "redhat", "centos", "scientific", "fedora", "arch"
24 | package "mod_wsgi"
25 | end
26 |
27 | apache_module "wsgi"
28 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/deflate.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | AddOutputFilterByType DEFLATE text/html
3 | AddOutputFilterByType DEFLATE text/css
4 | AddOutputFilterByType DEFLATE text/plain
5 | AddOutputFilterByType DEFLATE text/xml
6 | AddOutputFilterByType DEFLATE application/xhtml+xml
7 | AddOutputFilterByType DEFLATE application/xml
8 | AddOutputFilterByType DEFLATE image/svg+xml
9 | AddOutputFilterByType DEFLATE application/rss+xml
10 | AddOutputFilterByType DEFLATE application/atom_xml
11 | AddOutputFilterByType DEFLATE application/javascript
12 | AddOutputFilterByType DEFLATE application/x-javascript
13 | AddOutputFilterByType DEFLATE application/x-httpd-php
14 | AddOutputFilterByType DEFLATE application/x-httpd-fastphp
15 | AddOutputFilterByType DEFLATE application/x-httpd-eruby
16 |
17 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/fssle_rvm.rb:
--------------------------------------------------------------------------------
1 | # see: http://li109-47.members.linode.com/blog/
2 | package "curl"
3 | package "git-core"
4 |
5 | include_recipe "build-essential"
6 |
7 | %w(libreadline5-dev zlib1g-dev libssl-dev libxml2-dev libxslt1-dev).each do |pkg|
8 | package pkg
9 | end
10 |
11 | bash "install RVM" do
12 | user "root"
13 | code "bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)"
14 | #not_if "rvm --version"
15 | end
16 |
17 | log "run bashrc"
18 | bash "enable rvm" do
19 | user "root"
20 | code "source ~/.bashrc"
21 | end
22 |
23 | #bash "install REE in RVM" do
24 | # user "root"
25 | # code "rvm install ree"
26 | # not_if "rvm list | grep ree"
27 | #end
28 |
29 | #bash "make REE the default ruby" do
30 | # user "root"
31 | # code "rvm --default ree"
32 | #end
33 |
34 | gem_package "bundle"
35 | gem_package "chef" # re-install the chef gem into REE to enable subsequent chef-client runs
36 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/a2dissite.erb:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | SYSCONFDIR='<%= node[:apache][:dir] %>'
4 |
5 | if [ -z $1 ]; then
6 | echo "Which site would you like to disable?"
7 | echo -n "Your choices are: "
8 | ls $SYSCONFDIR/sites-enabled/* | \
9 | sed -e "s,$SYSCONFDIR/sites-enabled/,,g" | xargs echo
10 | echo -n "Site name? "
11 | read SITENAME
12 | else
13 | SITENAME=$1
14 | fi
15 |
16 | if [ $SITENAME = "default" ]; then
17 | PRIORITY="000"
18 | fi
19 |
20 | if ! [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
21 | -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
22 | echo "This site is already disabled, or does not exist!"
23 | exit 1
24 | fi
25 |
26 | if ! rm $SYSCONFDIR/sites-enabled/$SITENAME 2>/dev/null; then
27 | rm -f $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
28 | fi
29 | echo "Site $SITENAME disabled; reload apache to disable."
30 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_xsendfile.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: mod_xsendfile
4 | #
5 | # Copyright 2011, CustomInk, LLC.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | case node['platform']
21 | when "debian","ubuntu"
22 | package "libapache2-mod-xsendfile"
23 | when "centos","redhat","scientific","fedora"
24 | package "mod_xsendfile"
25 | end
26 |
27 | apache_module "xsendfile"
28 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/alias.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Aliases: Add here as many aliases as you need (with no limit). The format is
4 | # Alias fakename realname
5 | #
6 | # Note that if you include a trailing / on fakename then the server will
7 | # require it to be present in the URL. So "/icons" isn't aliased in this
8 | # example, only "/icons/". If the fakename is slash-terminated, then the
9 | # realname must also be slash terminated, and if the fakename omits the
10 | # trailing slash, the realname must also omit it.
11 | #
12 | # We include the /icons/ alias for FancyIndexed directory listings. If
13 | # you do not use FancyIndexing, you may comment this out.
14 | #
15 | Alias /icons/ "<%= node[:apache][:icondir] %>"
16 |
17 | ">
18 | Options Indexes MultiViews
19 | AllowOverride None
20 | Order allow,deny
21 | Allow from all
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_dav_svn.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: dav_svn
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | package "libapache2-svn" do
21 | case node['platform']
22 | when "centos","redhat","scientific","fedora","suse"
23 | package_name "mod_dav_svn"
24 | else
25 | package_name "libapache2-svn"
26 | end
27 | end
28 |
29 | apache_module "dav_svn"
30 |
--------------------------------------------------------------------------------
/fssle_api/.chef/knife.rb:
--------------------------------------------------------------------------------
1 | current_dir = File.dirname(__FILE__)
2 | log_level :info
3 | log_location STDOUT
4 | node_name "lite"
5 | client_key "#{current_dir}/lite.pem"
6 | validation_client_name "fssle-validator"
7 | validation_key "#{current_dir}/fssle-validator.pem"
8 | chef_server_url "https://api.opscode.com/organizations/fssle"
9 | cache_type 'BasicFile'
10 | cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
11 | cookbook_path ["#{current_dir}/../cookbooks"]
12 | #chef_home = "#{ENV['HOME']}/.chef"
13 |
14 | # ec2
15 | #
16 | knife[:aws_access_key_id] = "#{ENV['AWS_ACCESS_KEY_ID']}"
17 | knife[:aws_secret_access_key] = "#{ENV['AWS_SECRET_ACCESS_KEY']}"
18 | knife[:identity_file] = 'fssle-ec2.pem'
19 | knife[:aws_ssh_key_id] = "fssle-ec2"
20 | knife[:availability_zone] = 'us-west-1a'
21 | knife[:region] = 'us-west-1'
22 | knife[:aws_image_id] = 'ami-43580406'
23 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/definitions/apache_conf.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Definition:: apache_conf
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | define :apache_conf do
21 | template "#{node[:apache][:dir]}/mods-available/#{params[:name]}.conf" do
22 | source "mods/#{params[:name]}.conf.erb"
23 | notifies :restart, resources(:service => "apache2")
24 | mode 0644
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/fssle_wiki/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: http://rubygems.org/
3 | specs:
4 | albino (1.3.3)
5 | posix-spawn (>= 0.3.6)
6 | diff-lcs (1.1.3)
7 | github-markup (0.5.3)
8 | gollum (1.3.1)
9 | albino (~> 1.3.2)
10 | github-markup (>= 0.4.0, < 1.0.0)
11 | grit (~> 2.4.1)
12 | mustache (>= 0.11.2, < 1.0.0)
13 | nokogiri (~> 1.4)
14 | redcarpet
15 | sanitize (~> 2.0.0)
16 | sinatra (~> 1.0)
17 | grit (2.4.1)
18 | diff-lcs (~> 1.1)
19 | mime-types (~> 1.15)
20 | mime-types (1.17.2)
21 | mustache (0.99.4)
22 | nokogiri (1.5.0)
23 | posix-spawn (0.3.6)
24 | rack (1.3.5)
25 | rack-protection (1.1.4)
26 | rack
27 | rdiscount (1.6.8)
28 | redcarpet (1.17.2)
29 | sanitize (2.0.3)
30 | nokogiri (>= 1.4.4, < 1.6)
31 | sinatra (1.3.1)
32 | rack (~> 1.3, >= 1.3.4)
33 | rack-protection (~> 1.1, >= 1.1.2)
34 | tilt (~> 1.3, >= 1.3.3)
35 | tilt (1.3.3)
36 |
37 | PLATFORMS
38 | ruby
39 |
40 | DEPENDENCIES
41 | gollum
42 | rdiscount
43 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/files/default/apache2_module_conf_generate.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | =begin
4 |
5 | Generates Ubuntu style module.load files.
6 |
7 | ./apache2_module_conf_generate.pl /usr/lib64/httpd/modules /etc/httpd/mods-available
8 |
9 | ARGV[0] is the apache modules directory, ARGV[1] is where you want 'em.
10 |
11 | =cut
12 |
13 | use File::Find;
14 |
15 | use strict;
16 | use warnings;
17 |
18 | die "Must have '/path/to/modules' and '/path/to/modules.load'"
19 | unless $ARGV[0] && $ARGV[1];
20 |
21 | find(
22 | {
23 | wanted => sub {
24 | return 1 if $File::Find::name !~ /\.so$/;
25 | my $modfile = $_;
26 | $modfile =~ /(lib|mod_)(.+)\.so$/;
27 | my $modname = $2;
28 | my $filename = "$ARGV[1]/$modname.load";
29 | unless ( -f $filename ) {
30 | open( FILE, ">", $filename ) or die "Cannot open $filename";
31 | print FILE "LoadModule " . $modname . "_module $File::Find::name\n";
32 | close(FILE);
33 | }
34 | },
35 | follow => 1,
36 | },
37 | $ARGV[0]
38 | );
39 |
40 | exit 0;
41 |
42 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_python.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: python
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | case node[:platform]
21 | when "debian", "ubuntu"
22 | package "libapache2-mod-python" do
23 | action :install
24 | end
25 | when "redhat", "centos", "scientific", "fedora"
26 | package "mod_python" do
27 | action :install
28 | notifies :run, resources(:execute => "generate-module-list"), :immediately
29 | end
30 | end
31 |
32 | apache_module "python"
33 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/a2ensite.erb:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | SYSCONFDIR='<%= node[:apache][:dir] %>'
4 |
5 | if [ -z $1 ]; then
6 | echo "Which site would you like to enable?"
7 | echo -n "Your choices are: "
8 | ls $SYSCONFDIR/sites-available/* | \
9 | sed -e "s,$SYSCONFDIR/sites-available/,,g" | xargs echo
10 | echo -n "Site name? "
11 | read SITENAME
12 | else
13 | SITENAME=$1
14 | fi
15 |
16 | if [ $SITENAME = "default" ]; then
17 | PRIORITY="000"
18 | fi
19 |
20 | if [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
21 | -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
22 | echo "This site is already enabled!"
23 | exit 0
24 | fi
25 |
26 | if ! [ -e $SYSCONFDIR/sites-available/$SITENAME ]; then
27 | echo "This site does not exist!"
28 | exit 1
29 | fi
30 |
31 | if [ $SITENAME = "default" ]; then
32 | ln -sf $SYSCONFDIR/sites-available/$SITENAME \
33 | $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME"
34 | else
35 | ln -sf $SYSCONFDIR/sites-available/$SITENAME $SYSCONFDIR/sites-enabled/$SITENAME
36 | fi
37 |
38 | echo "Site $SITENAME installed; reload apache to enable."
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/templates/default/passenger_web_app.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | ServerName <%= @params[:server_name] %>
3 | ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
4 | DocumentRoot <%= @params[:docroot] %>
5 |
6 | RailsBaseURI /
7 | RailsEnv <%= @params[:rails_env] %>
8 |
9 | >
10 | Options FollowSymLinks
11 | AllowOverride None
12 | Order allow,deny
13 | Allow from all
14 |
15 |
16 | LogLevel info
17 | ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
18 | CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined
19 |
20 | RewriteEngine On
21 | RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
22 | RewriteLogLevel 0
23 | # Canonical host
24 | RewriteCond %{HTTP_HOST} !^<%= @params[:server_name] %> [NC]
25 | RewriteCond %{HTTP_HOST} !^$
26 | RewriteRule ^/(.*)$ http://<%= @params[:server_name] %>/$1 [L,R=301]
27 |
28 | RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
29 | RewriteCond %{SCRIPT_FILENAME} !maintenance.html
30 | RewriteRule ^.*$ /system/maintenance.html [L]
31 |
32 |
33 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/templates/default/web_app.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | ServerName <%= @params[:server_name] %>
3 | ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
4 | DocumentRoot <%= @params[:docroot] %>
5 |
6 | RailsBaseURI /
7 | RailsEnv <%= @params[:rails_env] %>
8 | RailsAllowModRewrite on
9 |
10 | >
11 | Options FollowSymLinks
12 | AllowOverride None
13 | Order allow,deny
14 | Allow from all
15 |
16 |
17 | LogLevel info
18 | ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
19 | CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined
20 |
21 | RewriteEngine On
22 | RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
23 | RewriteLogLevel 0
24 | # Canonical host
25 | RewriteCond %{HTTP_HOST} !^<%= @params[:server_name] %> [NC]
26 | RewriteCond %{HTTP_HOST} !^$
27 | RewriteRule ^/(.*)$ http://<%= @params[:server_name] %>/$1 [L,R=301]
28 |
29 | RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
30 | RewriteCond %{SCRIPT_FILENAME} !maintenance.html
31 | RewriteRule ^.*$ /system/maintenance.html [L]
32 |
33 |
34 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/resources/repository.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apt
3 | # Resource:: repository
4 | #
5 | # Copyright 2010-2011, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | actions :add, :remove
21 |
22 | #name of the repo, used for source.list filename
23 | attribute :repo_name, :kind_of => String, :name_attribute => true
24 | attribute :uri, :kind_of => String
25 | attribute :distribution, :kind_of => String
26 | attribute :components, :kind_of => Array, :default => []
27 | #whether or not to add the repository as a source repo as well
28 | attribute :deb_src, :default => false
29 | attribute :keyserver, :kind_of => String, :default => nil
30 | attribute :key, :kind_of => String, :default => nil
31 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/setenvif.conf.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | #
4 | # The following directives modify normal HTTP response behavior to
5 | # handle known problems with browser implementations.
6 | #
7 | BrowserMatch "Mozilla/2" nokeepalive
8 | BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
9 | BrowserMatch "RealPlayer 4\.0" force-response-1.0
10 | BrowserMatch "Java/1\.0" force-response-1.0
11 | BrowserMatch "JDK/1\.0" force-response-1.0
12 |
13 | #
14 | # The following directive disables redirects on non-GET requests for
15 | # a directory that does not include the trailing slash. This fixes a
16 | # problem with Microsoft WebFolders which does not appropriately handle
17 | # redirects for folders with DAV methods.
18 | # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
19 | #
20 | BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
21 | BrowserMatch "MS FrontPage" redirect-carefully
22 | BrowserMatch "^WebDrive" redirect-carefully
23 | BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
24 | BrowserMatch "^gnome-vfs/1.0" redirect-carefully
25 | BrowserMatch "^XML Spy" redirect-carefully
26 | BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
27 |
28 |
29 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/fssle/recipes/fssle_mywiki.rb:
--------------------------------------------------------------------------------
1 | # This recipe installs the rea-env gem for the
2 | # fssle user.
3 |
4 | # Make sure we have a fssle user
5 | gem_package "gollum"
6 | gem_package "RedCloth"
7 |
8 | deploy_to="/tmp"
9 | app_id="mywiki"
10 |
11 | execute "get source by git clone" do
12 | command "git clone git://github.com/lite/fssle_wiki.git #{app_id}"
13 | not_if {File.exists?("#{deploy_to}/#{app_id}")}
14 | user "root"
15 | cwd "#{deploy_to}"
16 | timeout 300
17 | end
18 |
19 | template "#{deploy_to}/#{app_id}/config.ru" do
20 | source "config.ru.erb"
21 | end
22 |
23 | bash "run bundle install" do
24 | user "root"
25 | cwd "#{deploy_to}/#{app_id}"
26 | code <<-EOH
27 | bundle install
28 | EOH
29 | end
30 |
31 | web_app 'mywiki' do
32 | docroot "#{deploy_to}/#{app_id}/public"
33 | template "mywiki.conf.erb"
34 | server_name "www.fssle.com"
35 | end
36 |
37 | apache_site "000-default" do
38 | enable false
39 | end
40 |
41 | # directory "/opt/fssle/git" do
42 | # owner "fssle"
43 | # group "fssle"
44 | # mode "0750"
45 | # recursive true
46 | # end
47 |
48 | # execute "run gollum" do
49 | # command "gollum --port 8080"
50 | # user "fssle"
51 | # group "fssle"
52 | # cwd "/opt/fssle/git/wiki"
53 | # timeout 300
54 | # end
55 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/build-essential/recipes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: build-essential
3 | # Recipe:: default
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | case node['platform']
21 | when "ubuntu","debian"
22 | %w{build-essential binutils-doc}.each do |pkg|
23 | package pkg do
24 | action :install
25 | end
26 | end
27 | when "centos","redhat","fedora"
28 | %w{gcc gcc-c++ kernel-devel make}.each do |pkg|
29 | package pkg do
30 | action :install
31 | end
32 | end
33 | end
34 |
35 | package "autoconf" do
36 | action :install
37 | end
38 |
39 | package "flex" do
40 | action :install
41 | end
42 |
43 | package "bison" do
44 | action :install
45 | end
46 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/a2enmod.erb:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | SYSCONFDIR='<%= node[:apache][:dir] %>'
4 |
5 | if [ -z $1 ]; then
6 | echo "Which module would you like to enable?"
7 | echo -n "Your choices are: "
8 | ls $SYSCONFDIR/mods-available/*.load | \
9 | sed -e "s,$SYSCONFDIR/mods-available/,,g" | sed -e 's/\.load$//g;' | xargs echo
10 | echo -n "Module name? "
11 | read MODNAME
12 | else
13 | MODNAME=$1
14 | fi
15 |
16 | #figure out if we're on a prefork or threaded mpm
17 | if [ -x /usr/sbin/apache2 ]; then
18 | PREFORK=`/usr/sbin/apache2 -l | grep prefork || true`
19 | fi
20 |
21 | if [ -e $SYSCONFDIR/mods-enabled/$MODNAME.load && -e $SYSCONFDIR/mods-enabled/$MODNAME.conf ]; then
22 | echo "This module is already enabled!"
23 | exit 0
24 | fi
25 |
26 | if ! [ -e $SYSCONFDIR/mods-available/$MODNAME.load ]; then
27 | echo "This module does not exist!"
28 | exit 1
29 | fi
30 |
31 | for i in conf load; do
32 | if [ -e $SYSCONFDIR/mods-available/$MODNAME.$i -a ! -e $SYSCONFDIR/mods-enabled/$MODNAME.$i ]; then
33 | ln -sf $SYSCONFDIR/mods-available/$MODNAME.$i $SYSCONFDIR/mods-enabled/$MODNAME.$i;
34 | fi
35 | done
36 |
37 | echo "Module $MODNAME installed; reload apache to enable."
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/god_monitor.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: god_monitor
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | apache_service = service "apache2" do
21 | action :nothing
22 | end
23 |
24 | start_command = apache_service.start_command
25 | stop_command = apache_service.stop_command
26 | restart_command = apache_service.restart_command
27 |
28 | god_monitor "apache2" do
29 | config "apache2.god.erb"
30 | start (start_command)?start_command : "/etc/init.d/#{apache_service.service_name} start"
31 | restart (restart_command)?restart_command : "/etc/init.d/#{apache_service.service_name} restart"
32 | stop (stop_command)?stop_command : "/etc/init.d/#{apache_service.service_name} stop"
33 | end
34 |
--------------------------------------------------------------------------------
/fssle_api/definitions/fssle/definition.rb:
--------------------------------------------------------------------------------
1 | Veewee::Session.declare({
2 | :cpu_count => '1', :memory_size=> '384',
3 | :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
4 | :os_type_id => 'Ubuntu',
5 | :iso_file => "ubuntu-11.04-server-i386.iso",
6 | :iso_src => "http://releases.ubuntu.com/11.04/ubuntu-11.04-server-i386.iso",
7 | :iso_md5 => "ce1cee108de737d7492e37069eed538e",
8 | :iso_download_timeout => "1000",
9 | :boot_wait => "10", :boot_cmd_sequence => [
10 | '',
11 | '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
12 | 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
13 | 'hostname=%NAME% ',
14 | 'fb=false debconf/frontend=noninteractive ',
15 | 'keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
16 | 'initrd=/install/initrd.gz -- '
17 | ],
18 | :kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "preseed.cfg",
19 | :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
20 | :ssh_host_port => "7222", :ssh_guest_port => "22",
21 | :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22 | :shutdown_cmd => "shutdown -P now",
23 | :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
24 | })
25 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/files/default/apt-proxy-v2.conf:
--------------------------------------------------------------------------------
1 | [DEFAULT]
2 | ;; All times are in seconds, but you can add a suffix
3 | ;; for minutes(m), hours(h) or days(d)
4 |
5 | ;; commented out address so apt-proxy will listen on all IPs
6 | ;; address = 127.0.0.1
7 | port = 9999
8 | cache_dir = /var/cache/apt-proxy
9 |
10 | ;; Control files (Packages/Sources/Contents) refresh rate
11 | min_refresh_delay = 1s
12 | complete_clientless_downloads = 1
13 |
14 | ;; Debugging settings.
15 | debug = all:4 db:0
16 |
17 | time = 30
18 | passive_ftp = on
19 |
20 | ;;--------------------------------------------------------------
21 | ;; Cache housekeeping
22 |
23 | cleanup_freq = 1d
24 | max_age = 120d
25 | max_versions = 3
26 |
27 | ;;---------------------------------------------------------------
28 | ;; Backend servers
29 | ;;
30 | ;; Place each server in its own [section]
31 |
32 | [ubuntu]
33 | ; Ubuntu archive
34 | backends =
35 | http://us.archive.ubuntu.com/ubuntu
36 |
37 | [ubuntu-security]
38 | ; Ubuntu security updates
39 | backends = http://security.ubuntu.com/ubuntu
40 |
41 | [debian]
42 | ;; Backend servers, in order of preference
43 | backends =
44 | http://debian.osuosl.org/debian/
45 |
46 | [security]
47 | ;; Debian security archive
48 | backends =
49 | http://security.debian.org/debian-security
50 | http://ftp2.de.debian.org/debian-security
51 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/recipes/cacher.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apt
3 | # Recipe:: cacher
4 | #
5 | # Copyright 2008-2011, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | package "apt-cacher" do
20 | action :install
21 | end
22 |
23 | service "apt-cacher" do
24 | supports :restart => true, :status => false
25 | action [ :enable, :start ]
26 | end
27 |
28 | cookbook_file "/etc/apt-cacher/apt-cacher.conf" do
29 | source "apt-cacher.conf"
30 | owner "root"
31 | group "root"
32 | mode 0644
33 | notifies :restart, resources(:service => "apt-cacher")
34 | end
35 |
36 | cookbook_file "/etc/default/apt-cacher" do
37 | source "apt-cacher"
38 | owner "root"
39 | group "root"
40 | mode 0644
41 | notifies :restart, resources(:service => "apt-cacher")
42 | end
43 |
44 | #this will help seed the proxy
45 | include_recipe "apt::cacher-client"
46 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/web_app.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | ServerName <%= @params[:server_name] %>
3 | ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
4 | DocumentRoot <%= @params[:docroot] %>
5 | RewriteEngine On
6 |
7 | >
8 | Options FollowSymLinks
9 | AllowOverride None
10 | Order allow,deny
11 | Allow from all
12 |
13 |
14 |
15 | Options FollowSymLinks
16 | AllowOverride None
17 |
18 |
19 |
20 | SetHandler server-status
21 |
22 | Order Deny,Allow
23 | Deny from all
24 | Allow from 127.0.0.1
25 |
26 |
27 | LogLevel info
28 | ErrorLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
29 | CustomLog <%= node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined
30 |
31 | RewriteEngine On
32 | RewriteLog <%= node[:apache][:log_dir] %>/<%= @application_name %>-rewrite.log
33 | RewriteLogLevel 0
34 |
35 | # Canonical host, <%= @params[:server_name] %>
36 | RewriteCond %{HTTP_HOST} !^<%= @params[:server_name] %> [NC]
37 | RewriteCond %{HTTP_HOST} !^$
38 | RewriteRule ^/(.*)$ http://<%= @params[:server_name] %>/$1 [L,R=301]
39 |
40 | RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
41 | RewriteCond %{SCRIPT_FILENAME} !maintenance.html
42 | RewriteRule ^.*$ /system/maintenance.html [L]
43 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/recipes/mod_rails.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: passenger_apache2
3 | # Recipe:: default
4 | #
5 | # Author:: Joshua Timberman ()
6 | # Author:: Joshua Sierles ()
7 | # Author:: Michael Hale ()
8 | #
9 | # Copyright:: 2009, Opscode, Inc
10 | # Copyright:: 2009, 37signals
11 | # Coprighty:: 2009, Michael Hale
12 | #
13 | # Licensed under the Apache License, Version 2.0 (the "License");
14 | # you may not use this file except in compliance with the License.
15 | # You may obtain a copy of the License at
16 | #
17 | # http://www.apache.org/licenses/LICENSE-2.0
18 | #
19 | # Unless required by applicable law or agreed to in writing, software
20 | # distributed under the License is distributed on an "AS IS" BASIS,
21 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 | # See the License for the specific language governing permissions and
23 | # limitations under the License.
24 |
25 | include_recipe "passenger_apache2"
26 |
27 | template "#{node[:apache][:dir]}/mods-available/passenger.load" do
28 | cookbook "passenger_apache2"
29 | source "passenger.load.erb"
30 | owner "root"
31 | group "root"
32 | mode 0755
33 | end
34 |
35 | template "#{node[:apache][:dir]}/mods-available/passenger.conf" do
36 | cookbook "passenger_apache2"
37 | source "passenger.conf.erb"
38 | owner "root"
39 | group "root"
40 | mode 0755
41 | end
42 |
43 | apache_module "passenger"
44 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_ssl.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: ssl
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | if platform?("redhat", "centos", "scientific", "fedora")
21 | package "mod_ssl" do
22 | action :install
23 | notifies :run, resources(:execute => "generate-module-list"), :immediately
24 | end
25 |
26 | file "#{node[:apache][:dir]}/conf.d/ssl.conf" do
27 | action :delete
28 | backup false
29 | end
30 | end
31 |
32 | ports = node[:apache][:listen_ports].include?("443") ? node[:apache][:listen_ports] : [node[:apache][:listen_ports], "443"].flatten
33 |
34 | template "#{node[:apache][:dir]}/ports.conf" do
35 | source "ports.conf.erb"
36 | variables :apache_listen_ports => ports.map{|p| p.to_i}.uniq
37 | notifies :restart, resources(:service => "apache2")
38 | mode 0644
39 | end
40 |
41 | apache_module "ssl" do
42 | conf true
43 | end
44 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/recipes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: passenger_apache2
3 | # Recipe:: default
4 | #
5 | # Author:: Joshua Timberman ()
6 | # Author:: Joshua Sierles ()
7 | # Author:: Michael Hale ()
8 | #
9 | # Copyright:: 2009, Opscode, Inc
10 | # Copyright:: 2009, 37signals
11 | # Coprighty:: 2009, Michael Hale
12 | #
13 | # Licensed under the Apache License, Version 2.0 (the "License");
14 | # you may not use this file except in compliance with the License.
15 | # You may obtain a copy of the License at
16 | #
17 | # http://www.apache.org/licenses/LICENSE-2.0
18 | #
19 | # Unless required by applicable law or agreed to in writing, software
20 | # distributed under the License is distributed on an "AS IS" BASIS,
21 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 | # See the License for the specific language governing permissions and
23 | # limitations under the License.
24 |
25 | include_recipe "apache2"
26 | include_recipe "build-essential"
27 |
28 | if platform?("centos","redhat")
29 | package "httpd-devel"
30 | package "curl-devel"
31 | else
32 | %w{ apache2-prefork-dev libapr1-dev libcurl4-gnutls-dev }.each do |pkg|
33 | package pkg do
34 | action :upgrade
35 | end
36 | end
37 | end
38 |
39 | gem_package "passenger" do
40 | version node[:passenger][:version]
41 | end
42 |
43 | execute "passenger_module" do
44 | command 'echo -en "\n\n\n\n" | passenger-install-apache2-module'
45 | creates node[:passenger][:module_path]
46 | end
47 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/recipes/cacher-client.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apt
3 | # Recipe:: cacher-client
4 | #
5 | # Copyright 2011, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | #remove Acquire::http::Proxy lines from /etc/apt/apt.conf since we use 01proxy
21 | #these are leftover from preseed installs
22 | execute "Remove proxy from /etc/apt/apt.conf" do
23 | command "sed --in-place '/^Acquire::http::Proxy/d' /etc/apt/apt.conf"
24 | only_if "grep Acquire::http::Proxy /etc/apt/apt.conf"
25 | end
26 |
27 | servers = search(:node, 'recipes:apt\:\:cacher') || []
28 | if servers.length > 0
29 | Chef::Log.info("apt-cacher server found on #{servers[0]}.")
30 | proxy = "Acquire::http::Proxy \"http://#{servers[0].ipaddress}:3142\";\n"
31 | file "/etc/apt/apt.conf.d/01proxy" do
32 | owner "root"
33 | group "root"
34 | mode "0644"
35 | content proxy
36 | action :create
37 | end
38 | else
39 | Chef::Log.info("No apt-cacher server found.")
40 | file "/etc/apt/apt.conf.d/01proxy" do
41 | action :delete
42 | only_if {File.exists?("/etc/apt/apt.conf.d/01proxy")}
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/definitions/web_app.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Definition:: web_app
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | define :web_app, :template => "web_app.conf.erb", :enable => true do
21 |
22 | application_name = params[:name]
23 |
24 | include_recipe "apache2"
25 | include_recipe "apache2::mod_rewrite"
26 | include_recipe "apache2::mod_deflate"
27 | include_recipe "apache2::mod_headers"
28 |
29 | template "#{node[:apache][:dir]}/sites-available/#{application_name}.conf" do
30 | source params[:template]
31 | owner "root"
32 | group "root"
33 | mode 0644
34 | if params[:cookbook]
35 | cookbook params[:cookbook]
36 | end
37 | variables(
38 | :application_name => application_name,
39 | :params => params
40 | )
41 | if ::File.exists?("#{node[:apache][:dir]}/sites-enabled/#{application_name}.conf")
42 | notifies :reload, resources(:service => "apache2"), :delayed
43 | end
44 | end
45 |
46 | apache_site "#{params[:name]}.conf" do
47 | enable params[:enable]
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/recipes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apt
3 | # Recipe:: default
4 | #
5 | # Copyright 2008-2011, Opscode, Inc.
6 | # Copyright 2009, Bryan McLellan
7 | #
8 | # Licensed under the Apache License, Version 2.0 (the "License");
9 | # you may not use this file except in compliance with the License.
10 | # You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | # Run apt-get update to create the stamp file
22 | execute "apt-get-update" do
23 | command "apt-get update"
24 | ignore_failure true
25 | not_if do ::File.exists?('/var/lib/apt/periodic/update-success-stamp') end
26 | action :nothing
27 | end
28 |
29 | # provides /var/lib/apt/periodic/update-success-stamp on apt-get update
30 | package "update-notifier-common" do
31 | notifies :run, resources(:execute => "apt-get-update"), :immediately
32 | end
33 |
34 | execute "apt-get-update-periodic" do
35 | command "apt-get update"
36 | ignore_failure true
37 | only_if do
38 | File.exists?('/var/lib/apt/periodic/update-success-stamp') &&
39 | File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400
40 | end
41 | end
42 |
43 | %w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|
44 | directory dirname do
45 | owner "root"
46 | group "root"
47 | mode 0644
48 | action :create
49 | end
50 | end
51 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/definitions/apache_site.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Definition:: apache_site
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | define :apache_site, :enable => true do
21 | include_recipe "apache2"
22 |
23 | if params[:enable]
24 | execute "a2ensite #{params[:name]}" do
25 | command "/usr/sbin/a2ensite #{params[:name]}"
26 | notifies :restart, resources(:service => "apache2")
27 | not_if do
28 | ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
29 | ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
30 | end
31 | only_if do ::File.exists?("#{node[:apache][:dir]}/sites-available/#{params[:name]}") end
32 | end
33 | else
34 | execute "a2dissite #{params[:name]}" do
35 | command "/usr/sbin/a2dissite #{params[:name]}"
36 | notifies :restart, resources(:service => "apache2")
37 | only_if do
38 | ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
39 | ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
40 | end
41 | end
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/security.erb:
--------------------------------------------------------------------------------
1 | #
2 | # Disable access to the entire file system except for the directories that
3 | # are explicitly allowed later.
4 | #
5 | # This currently breaks the configurations that come with some web application
6 | # Debian packages. It will be made the default for the release after lenny.
7 | #
8 | #
9 | # AllowOverride None
10 | # Order Deny,Allow
11 | # Deny from all
12 | #
13 |
14 |
15 | # Changing the following options will not really affect the security of the
16 | # server, but might make attacks slightly more difficult in some cases.
17 |
18 | #
19 | # ServerTokens
20 | # This directive configures what you return as the Server HTTP response
21 | # Header. The default is 'Full' which sends information about the OS-Type
22 | # and compiled in modules.
23 | # Set to one of: Full | OS | Minimal | Minor | Major | Prod
24 | # where Full conveys the most information, and Prod the least.
25 | #
26 | #ServerTokens Minimal
27 | ServerTokens <%= node[:apache][:servertokens] %>
28 |
29 | #
30 | # Optionally add a line containing the server version and virtual host
31 | # name to server-generated pages (internal error documents, FTP directory
32 | # listings, mod_status and mod_info output etc., but not CGI generated
33 | # documents or custom error documents).
34 | # Set to "EMail" to also include a mailto: link to the ServerAdmin.
35 | # Set to one of: On | Off | EMail
36 | #
37 | #ServerSignature Off
38 | ServerSignature <%= node[:apache][:serversignature] %>
39 |
40 | #
41 | # Allow TRACE method
42 | #
43 | # Set to "extended" to also reflect the request body (only for testing and
44 | # diagnostic purposes).
45 | #
46 | # Set to one of: On | Off | extended
47 | #
48 | #TraceEnable Off
49 | TraceEnable <%= node[:apache][:traceenable] %>
50 |
51 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_fcgid.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: fcgid
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | if platform?("debian", "ubuntu")
21 | package "libapache2-mod-fcgid"
22 | elsif platform?("redhat", "centos", "scientific", "fedora", "arch")
23 | package "mod_fcgid" do
24 | notifies :run, resources(:execute => "generate-module-list"), :immediately
25 | end
26 |
27 | file "#{node[:apache][:dir]}/conf.d/fcgid.conf" do
28 | action :delete
29 | backup false
30 | end
31 |
32 | if node['platform_version'].to_i >= 6
33 | directory "/var/run/httpd/mod_fcgid" do
34 | recursive true
35 | end
36 | end
37 | elsif platform?("suse")
38 | apache_lib_path = node[:apache][:lib_dir]
39 |
40 | package "httpd-devel"
41 |
42 | bash "install-fcgid" do
43 | code <<-EOH
44 | (cd #{Chef::Config[:file_cache_path]}; wget http://superb-east.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.2.tgz)
45 | (cd #{Chef::Config[:file_cache_path]}; tar zxvf mod_fcgid.2.2.tgz)
46 | (cd #{Chef::Config[:file_cache_path]}; perl -pi -e 's!/usr/local/apache2!#{apache_lib_path}!g' ./mod_fcgid.2.2/Makefile)
47 | (cd #{Chef::Config[:file_cache_path]}/mod_fcgid.2.2; make install)
48 | EOH
49 | end
50 | end
51 |
52 | apache_module "fcgid" do
53 | conf true
54 | end
55 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/libraries/ec2.rb:
--------------------------------------------------------------------------------
1 | # TODO: once sync_libraries properly handles sub-directories, move this file to aws/libraries/opscode/aws/ec2.rb
2 |
3 | begin
4 | require 'right_aws'
5 | rescue LoadError
6 | Chef::Log.warn("Missing gem 'right_aws'")
7 | end
8 |
9 | require 'open-uri'
10 |
11 | module Opscode
12 | module Aws
13 | module Ec2
14 | def find_snapshot_id(volume_id="")
15 | snapshot_id = nil
16 | ec2.describe_snapshots.sort { |a,b| b[:aws_started_at] <=> a[:aws_started_at] }.each do |snapshot|
17 | if snapshot[:aws_volume_id] == volume_id
18 | snapshot_id = snapshot[:aws_id]
19 | end
20 | end
21 | raise "Cannot find snapshot id!" unless snapshot_id
22 | Chef::Log.debug("Snapshot ID is #{snapshot_id}")
23 | snapshot_id
24 | end
25 |
26 | def ec2
27 | region = instance_availability_zone
28 | region = region[0, region.length-1]
29 | @@ec2 ||= RightAws::Ec2.new(new_resource.aws_access_key, new_resource.aws_secret_access_key, { :logger => Chef::Log, :region => region })
30 | end
31 |
32 | def instance_id
33 | @@instance_id ||= query_instance_id
34 | end
35 |
36 | def instance_availability_zone
37 | @@instance_availability_zone ||= query_instance_availability_zone
38 | end
39 |
40 | private
41 |
42 | def query_instance_id
43 | instance_id = open('http://169.254.169.254/latest/meta-data/instance-id'){|f| f.gets}
44 | raise "Cannot find instance id!" unless instance_id
45 | Chef::Log.debug("Instance ID is #{instance_id}")
46 | instance_id
47 | end
48 |
49 | def query_instance_availability_zone
50 | availability_zone = open('http://169.254.169.254/latest/meta-data/placement/availability-zone/'){|f| f.gets}
51 | raise "Cannot find availability zone!" unless availability_zone
52 | Chef::Log.debug("Instance's availability zone is #{availability_zone}")
53 | availability_zone
54 | end
55 |
56 | end
57 | end
58 | end
59 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/definitions/apache_module.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Definition:: apache_module
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | define :apache_module, :enable => true, :conf => false do
21 | include_recipe "apache2"
22 |
23 | params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
24 |
25 | if params[:conf]
26 | apache_conf params[:name]
27 | end
28 |
29 | if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse" )
30 | file "#{node['apache']['dir']}/mods-available/#{params[:name]}.load" do
31 | content "LoadModule #{params[:name]}_module #{node['apache']['lib_dir']}/modules/#{params[:filename]}\n"
32 | mode 0644
33 | end
34 | end
35 |
36 | if params[:enable]
37 | execute "a2enmod #{params[:name]}" do
38 | command "/usr/sbin/a2enmod #{params[:name]}"
39 | notifies :restart, resources(:service => "apache2")
40 | not_if do (File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") and
41 | ((File.exists?("#{node[:apache][:dir]}/mods-available/#{params[:name]}.conf"))?
42 | (File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.conf")):(true)))
43 | end
44 | end
45 | else
46 | execute "a2dismod #{params[:name]}" do
47 | command "/usr/sbin/a2dismod #{params[:name]}"
48 | notifies :restart, resources(:service => "apache2")
49 | only_if do ::File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") end
50 | end
51 | end
52 | end
53 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/default-site.erb:
--------------------------------------------------------------------------------
1 |
2 | ServerAdmin <%= node[:apache][:contact] %>
3 |
4 | DocumentRoot /var/www/
5 |
6 | Options FollowSymLinks
7 | AllowOverride None
8 |
9 |
10 | Options Indexes FollowSymLinks MultiViews
11 | AllowOverride None
12 | Order allow,deny
13 | allow from all
14 | # This directive allows us to have apache2's default start page
15 | # in /apache2-default/, but still have / go to the right place
16 | #RedirectMatch ^/$ /apache2-default/
17 |
18 |
19 | ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
20 |
21 | AllowOverride None
22 | Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
23 | Order allow,deny
24 | Allow from all
25 |
26 |
27 | ErrorLog <%= node[:apache][:log_dir] %>/error.log
28 |
29 | # Possible values include: debug, info, notice, warn, error, crit,
30 | # alert, emerg.
31 | LogLevel warn
32 |
33 | CustomLog <%= node[:apache][:log_dir] %>/access.log combined
34 | ServerSignature On
35 |
36 | Alias /doc/ "/usr/share/doc/"
37 |
38 | Options Indexes MultiViews FollowSymLinks
39 | AllowOverride None
40 | Order deny,allow
41 | Deny from all
42 | Allow from 127.0.0.0/255.0.0.0 ::1/128
43 |
44 |
45 | <% if %w{ redhat centos scientific fedora }.include?(node[:platform]) -%>
46 | #
47 | # This configuration file enables the default "Welcome"
48 | # page if there is no default index page present for
49 | # the root URL. To disable the Welcome page, comment
50 | # out all the lines below.
51 | #
52 |
53 | Options -Indexes
54 | ErrorDocument 403 /error/noindex.html
55 |
56 | <% end -%>
57 |
58 |
--------------------------------------------------------------------------------
/fssle_api/README:
--------------------------------------------------------------------------------
1 | * ec2
2 | https://console.aws.amazon.com/ec2/home?
3 |
4 | https://console.aws.amazon.com/ec2/home?region=us-west-1s=SecurityGroups
5 | 22 (SSH) 0.0.0.0/0 Delete
6 | 80 (HTTP) 0.0.0.0/0 Delete
7 | 8080 (HTTP) 0.0.0.0/0 Delete
8 |
9 | ssh-keygen -R www.fssle.com
10 | ssh -i fssle-ec2.pem ubuntu@www.fssle.com
11 |
12 | https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
13 | export AWS_ACCESS_KEY_ID=""
14 | export AWS_SECRET_ACCESS_KEY=""
15 |
16 | http://uec-images.ubuntu.com/server/releases/11.04/release/
17 | knife[:aws_access_key_id] = "#{ENV['AWS_ACCESS_KEY_ID']}"
18 | knife[:aws_secret_access_key] = "#{ENV['AWS_SECRET_ACCESS_KEY']}"
19 | knife[:identity_file] = 'fssle-ec2.pem'
20 | knife[:aws_ssh_key_id] = "fssle-ec2"
21 | knife[:availability_zone] = 'us-west-1a'
22 | knife[:region] = 'us-west-1'
23 | knife[:aws_image_id] = 'ami-43580406'
24 |
25 | knife ec2 server list
26 | knife ec2 server delete i-296cd36e
27 | knife ec2 server create -I ami-43580406 -f t1.micro -x ubuntu -G default
28 |
29 | * opscode
30 | https://community.opscode.com/users/username/user_key/new
31 | username.pem
32 | knife.rb
33 | org-validator.pem
34 |
35 | * cookbook
36 | knife cookbook site download apt
37 | knife cookbook site download aws
38 | knife cookbook site download apache2
39 |
40 | * chef
41 | * role
42 | knife role list
43 | export EDITOR=vim && knife role create base
44 | knife role edit base
45 | knife role show base
46 | knife role from file roles/base.rb
47 | * cookbook
48 | knife cookbook create fssle
49 | knife cookbook list
50 | knife cookbook site download aws apt libxml2-dev
51 | knife cookbook upload aws apt libxml2-dev
52 | * bootstrap
53 | knife ec2 server create -I ami-43580406 -f t1.micro -G default -region -S knife -i ./fssle-ec2.pem -x ubuntu
54 | knife bootstrap 50.18.74.70 -r "role[fssle]" -N i-ab46cfec -i fssle-ec2.pem -x ubuntu --sudo
55 | knife node run_list add i-ab46cfec "role[fssle]"
56 | * cucumber-chef
57 | cucumber-chef displayconfig
58 |
59 | http://gerhardlazu.com/2010/08/using-chef-to-manage-amazon-ec2-instances-part2/
60 | http://agiletesting.blogspot.com/2010/07/bootstrapping-ec2-instances-with-chef.html
61 | https://github.com/Atalanta/cucumber-chef
62 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_php5.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: php5
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | case node[:platform]
21 | when "debian", "ubuntu"
22 | package "libapache2-mod-php5" do
23 | action :install
24 | end
25 |
26 | when "arch"
27 | package "php-apache" do
28 | action :install
29 | notifies :run, resources(:execute => "generate-module-list"), :immediately
30 | end
31 |
32 | when "redhat", "centos", "scientific"
33 | package "php package" do
34 | if node.platform_version.to_f < 6.0
35 | package_name "php53"
36 | else
37 | package_name "php"
38 | end
39 | action :install
40 | notifies :run, resources(:execute => "generate-module-list"), :immediately
41 | end
42 |
43 | # delete stock config
44 | file "#{node[:apache][:dir]}/conf.d/php.conf" do
45 | action :delete
46 | end
47 |
48 | # replace with debian style config
49 | template "#{node[:apache][:dir]}/mods-available/php5.conf" do
50 | source "mods/php5.conf.erb"
51 | notifies :restart, "service[apache2]"
52 | end
53 |
54 | when "fedora"
55 | package "php package" do
56 | package_name "php"
57 | action :install
58 | notifies :run, resources(:execute => "generate-module-list"), :immediately
59 | end
60 |
61 | # delete stock config
62 | file "#{node[:apache][:dir]}/conf.d/php.conf" do
63 | action :delete
64 | end
65 |
66 | # replace with debian style config
67 | template "#{node[:apache][:dir]}/mods-available/php5.conf" do
68 | source "mods/php5.conf.erb"
69 | notifies :restart, "service[apache2]"
70 | end
71 | end
72 |
73 | apache_module "php5" do
74 | case node['platform']
75 | when "redhat","centos","scientific","fedora"
76 | filename "libphp5.so"
77 | end
78 | end
79 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/README.md:
--------------------------------------------------------------------------------
1 | Description
2 | ====
3 |
4 | Installs passenger for Apache 2.
5 |
6 | Changes
7 | ====
8 |
9 | ## v0.99.0:
10 |
11 | * Upgrade to passenger 3.0.7
12 | * Attributes are all "default"
13 | * Install curl development headers
14 | * Move PassengerMaxPoolSize to config of module instead of vhost.
15 |
16 | Requirements
17 | ====
18 |
19 | ## Platform
20 |
21 | Tested on Ubuntu 10.04. Should work on any Ubuntu/Debian platforms.
22 |
23 | ## Cookbooks
24 |
25 | Opscode cookbooks:
26 |
27 | * apache2
28 | * build-essential
29 |
30 | Attributes
31 | ====
32 |
33 | * `passenger[:version]` - Specify the version of passenger to install.
34 | * `passenger[:max_pool_size]` - Sets PassengerMaxPoolSize in the Apache module config.
35 | * `passenger[:root_path]` - The location of the passenger gem.
36 | * `passenger[:module_path]` - The location of the compiled passenger apache module.
37 |
38 | Usage
39 | ====
40 |
41 | For example, to run a Rails application on passenger:
42 |
43 | include_recipe "rails"
44 | include_recipe "passenger"
45 |
46 | web_app "myproj" do
47 | docroot "/srv/myproj/public"
48 | server_name "myproj.#{node[:domain]}"
49 | server_aliases [ "myproj", node[:hostname] ]
50 | rails_env "production"
51 | end
52 |
53 | A sample config template is provided, `web_app.conf.erb`. If this is suitable for your application, add 'cookbook "passenger"' to the define above to use that template. Otherwise, copy the template to the cookbook where you're using `web_app`, and modify as needed. The cookbook parameter is optional, if omitted it will search the cookbook where the define is used.
54 |
55 | License and Author
56 | ====
57 |
58 | Author:: Joshua Timberman ()
59 | Author:: Joshua Sierles ()
60 | Author:: Michael Hale ()
61 |
62 | Copyright:: 2009-2011, Opscode, Inc
63 | Copyright:: 2009, 37signals
64 | Coprighty:: 2009, Michael Hale
65 |
66 | Licensed under the Apache License, Version 2.0 (the "License");
67 | you may not use this file except in compliance with the License.
68 | You may obtain a copy of the License at
69 |
70 | http://www.apache.org/licenses/LICENSE-2.0
71 |
72 | Unless required by applicable law or agreed to in writing, software
73 | distributed under the License is distributed on an "AS IS" BASIS,
74 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 | See the License for the specific language governing permissions and
76 | limitations under the License.
77 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/providers/elastic_ip.rb:
--------------------------------------------------------------------------------
1 | include Opscode::Aws::Ec2
2 |
3 | action :associate do
4 | addr = address(new_resource.ip)
5 |
6 | if addr.nil?
7 | raise "Elastic IP #{new_resource.ip} does not exist"
8 | elsif addr[:instance_id] == instance_id
9 | Chef::Log.debug("Elastic IP #{new_resource.ip} is already attached to the instance")
10 | else
11 | attach(new_resource.ip, new_resource.timeout)
12 | new_resource.updated_by_last_action(true)
13 | Chef::Log.info("Attaching Elastic IP #{new_resource.ip} to the instance")
14 | end
15 | end
16 |
17 | action :disassociate do
18 | addr = address(new_resource.ip)
19 |
20 | if addr.nil?
21 | Chef::Log.debug("Elastic IP #{new_resource.ip} does not exist, so there is nothing to detach")
22 | elsif addr[:instance_id] != instance_id
23 | Chef::Log.debug("Elastic IP #{new_resource.ip} is already detached from the instance")
24 | else
25 | Chef::Log.info("Detaching Elastic IP #{new_resource.ip} from the instance")
26 | detach(new_resource.ip, new_resource.timeout)
27 | new_resource.updated_by_last_action(true)
28 | end
29 | end
30 |
31 | private
32 |
33 | def address(ip)
34 | ec2.describe_addresses.find{|a| a[:public_ip] == ip}
35 | end
36 |
37 | def attach(ip, timeout)
38 | ec2.associate_address(instance_id, ip)
39 |
40 | # block until attached
41 | begin
42 | Timeout::timeout(timeout) do
43 | while true
44 | addr = address(ip)
45 | if addr.nil?
46 | raise "Elastic IP has been deleted while waiting for attachment"
47 | elsif addr[:instance_id] == instance_id
48 | Chef::Log.debug("Elastic IP is attached to this instance")
49 | break
50 | else
51 | Chef::Log.debug("Elastic IP is currently attached to #{addr[:instance_id]}")
52 | end
53 | sleep 3
54 | end
55 | end
56 | rescue Timeout::Error
57 | raise "Timed out waiting for attachment after #{timeout} seconds"
58 | end
59 | end
60 |
61 | def detach(ip, timeout)
62 | ec2.disassociate_address(ip)
63 |
64 | # block until detached
65 | begin
66 | Timeout::timeout(timeout) do
67 | while true
68 | addr = address(ip)
69 | if addr.nil?
70 | Chef::Log.debug("Elastic IP has been deleted while waiting for detachment")
71 | elsif addr[:instance_id] != instance_id
72 | Chef::Log.debug("Elastic IP is detached from this instance")
73 | break
74 | else
75 | Chef::Log.debug("Elastic IP is still attached")
76 | end
77 | sleep 3
78 | end
79 | end
80 | rescue Timeout::Error
81 | raise "Timed out waiting for detachment after #{timeout} seconds"
82 | end
83 | end
84 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/ssl.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Pseudo Random Number Generator (PRNG):
4 | # Configure one or more sources to seed the PRNG of the SSL library.
5 | # The seed data should be of good random quality.
6 | # WARNING! On some platforms /dev/random blocks if not enough entropy
7 | # is available. This means you then cannot use the /dev/random device
8 | # because it would lead to very long connection times (as long as
9 | # it requires to make more entropy available). But usually those
10 | # platforms additionally provide a /dev/urandom device which doesn't
11 | # block. So, if available, use this one instead. Read the mod_ssl User
12 | # Manual for more details.
13 | #
14 | SSLRandomSeed startup builtin
15 | SSLRandomSeed startup file:/dev/urandom 512
16 | SSLRandomSeed connect builtin
17 | SSLRandomSeed connect file:/dev/urandom 512
18 |
19 | ##
20 | ## SSL Global Context
21 | ##
22 | ## All SSL configuration in this context applies both to
23 | ## the main server and all SSL-enabled virtual hosts.
24 | ##
25 |
26 | #
27 | # Some MIME-types for downloading Certificates and CRLs
28 | #
29 | AddType application/x-x509-ca-cert .crt
30 | AddType application/x-pkcs7-crl .crl
31 |
32 | # Pass Phrase Dialog:
33 | # Configure the pass phrase gathering process.
34 | # The filtering dialog program (`builtin' is a internal
35 | # terminal dialog) has to provide the pass phrase on stdout.
36 | SSLPassPhraseDialog builtin
37 |
38 | # Inter-Process Session Cache:
39 | # Configure the SSL Session Cache: First the mechanism
40 | # to use and second the expiring timeout (in seconds).
41 | #SSLSessionCache dbm:/var/run/apache2/ssl_scache
42 | <% if %w{ redhat centos scientific fedora }.include?(node[:platform]) -%>
43 | SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
44 | <% else -%>
45 | SSLSessionCache shmcb:/var/run/apache2/ssl_scache
46 | <% end -%>
47 | SSLSessionCacheTimeout 300
48 |
49 | # Semaphore:
50 | # Configure the path to the mutual exclusion semaphore the
51 | # SSL engine uses internally for inter-process synchronization.
52 | <% if %w{ redhat centos scientific fedora }.include?(node[:platform]) -%>
53 | SSLMutex default
54 | <% else -%>
55 | SSLMutex file:/var/run/apache2/ssl_mutex
56 | <% end -%>
57 |
58 | # SSL Cipher Suite:
59 | # List the ciphers that the client is permitted to negotiate.
60 | # See the mod_ssl documentation for a complete list.
61 | # enable only secure ciphers:
62 | SSLCipherSuite HIGH:MEDIUM:!ADH
63 | # Use this instead if you want to allow cipher upgrades via SGC facility.
64 | # In this case you also have to use something like
65 | # SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
66 | # see http://httpd.apache.org/docs/2.2/ssl/ssl_howto.html.en#upgradeenc
67 | #SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
68 |
69 | # enable only secure protocols: SSLv3 and TLSv1, but not SSLv2
70 | SSLProtocol all -SSLv2
71 |
72 |
73 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/providers/repository.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apt
3 | # Provider:: repository
4 | #
5 | # Copyright 2010-2011, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | action :add do
21 | unless ::File.exists?("/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list")
22 | Chef::Log.info "Adding #{new_resource.repo_name} repository to /etc/apt/sources.list.d/#{new_resource.repo_name}-source.list"
23 | # add key
24 | if new_resource.keyserver && new_resource.key
25 | execute "install-key #{new_resource.key}" do
26 | command "apt-key adv --keyserver #{new_resource.keyserver} --recv #{new_resource.key}"
27 | action :nothing
28 | end.run_action(:run)
29 | elsif new_resource.key && (new_resource.key =~ /http/)
30 | key_name = new_resource.key.split(/\//).last
31 | remote_file "#{Chef::Config[:file_cache_path]}/#{key_name}" do
32 | source new_resource.key
33 | mode "0644"
34 | action :nothing
35 | end.run_action(:create_if_missing)
36 | execute "install-key #{key_name}" do
37 | command "apt-key add #{Chef::Config[:file_cache_path]}/#{key_name}"
38 | action :nothing
39 | end.run_action(:run)
40 | end
41 | # build our listing
42 | repository = "deb"
43 | repository = "deb-src" if new_resource.deb_src
44 | repository = "# Created by the Chef apt_repository LWRP\n" + repository
45 | repository += " #{new_resource.uri}"
46 | repository += " #{new_resource.distribution}"
47 | new_resource.components.each {|component| repository += " #{component}"}
48 | # write out the file, replace it if it already exists
49 | file "/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list" do
50 | owner "root"
51 | group "root"
52 | mode 0644
53 | content repository + "\n"
54 | action :nothing
55 | end.run_action(:create)
56 | execute "update package index" do
57 | command "apt-get update"
58 | ignore_failure true
59 | action :nothing
60 | end.run_action(:run)
61 | new_resource.updated_by_last_action(true)
62 | end
63 | end
64 |
65 | action :remove do
66 | if ::File.exists?("/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list")
67 | Chef::Log.info "Removing #{new_resource.repo_name} repository from /etc/apt/sources.list.d/"
68 | file "/etc/apt/sources.list.d/#{new_resource.repo_name}-source.list" do
69 | action :delete
70 | end
71 | new_resource.updated_by_last_action(true)
72 | end
73 | end
74 |
--------------------------------------------------------------------------------
/fssle_api/StepByStep.markdown:
--------------------------------------------------------------------------------
1 | chef
2 | ====
3 |
4 | [Quick Start](http://wiki.opscode.com/display/chef/Quick+Start)
5 | [Ruby and Opscode Chef packages for RHEL distributions](http://rbel.frameos.org/)
6 | [Vagrant rocks](http://lumberjaph.net/misc/2010/11/22/vagrant-rocks.html)
7 | [Setting up a Rails 3 development environment](http://www.improvingwetware.com/2011/01/13/setting-up-a-rails-3-development-environment)
8 |
9 | workstation
10 | ----
11 |
12 | prepare
13 |
14 | gem update --system
15 | gem install chef
16 | cd ~
17 | git clone git://github.com/opscode/chef-repo.git
18 |
19 | mkdir -p ~/chef-repo/.chef
20 | cp USERNAME.pem ~/chef-repo/.chef
21 | cp ORGANIZATION-validator.pem ~/chef-repo/.chef
22 | cp knife.rb ~/chef-repo/.chef
23 |
24 | cookbooks and bootstrap
25 |
26 | cd ~/chef-repo
27 | ln -sn `pwd`/cookbooks ~/.chef
28 | ln -sn `pwd`/bootstrap ~/.chef
29 | knife client list
30 | knife cookbook site vendor chef-client
31 | knife cookbook upload chef-client
32 |
33 | bootstrap
34 |
35 | ssh root@fssle.com 'sh -c "mkdir ~/.ssh"'
36 | scp ~/.ssh/id_rsa.pub root@fssle.com:/root/.ssh/authorized_keys
37 | ssh root@fssle.com 'sh -c "uname -a;cat /etc/lsb-release"'
38 | knife bootstrap fssle.com -r "recipe[chef-client]" -x root
39 |
40 | ssh root@www.fssle.com 'sh -c "mkdir ~/.ssh"'
41 | scp ~/.ssh/id_rsa.pub root@www.fssle.com:/root/.ssh/authorized_keys
42 | ssh root@www.fssle.com 'sh -c "uname -a;cat /etc/lsb-release"'
43 | knife bootstrap www.fssle.com -r 'recipe[chef-client]' -x root -d rhel5-rbel
44 |
45 | knife node
46 |
47 | {
48 | "name": "fssle",
49 | "default_attributes": {
50 | "chef": {
51 | "server_url": "https://api.opscode.com/organizations/fssle",
52 | "cache_path": "/var/chef/cache",
53 | "backup_path": "/var/chef/backup",
54 | "validation_client_name": "fssle-validator",
55 | "run_path": "/var/chef"
56 | }
57 | },
58 | "json_class": "Chef::Role",
59 | "run_list": [
60 | "recipe[dev-fssle]",
61 | ],
62 | "description": "Basic Server",
63 | "chef_type": "role",
64 | "override_attributes": {
65 | }
66 | }
67 |
68 | knife role
69 |
70 | knife role create fssle
71 | knife role from file roles/fssle.rb
72 |
73 | knife node create www.fssle.com
74 | knife node create dev.fssle.com
75 |
76 | knife node run_list remove "dev.fssle.com" "role[base]"
77 | knife node run_list add "dev.fssle.com" dev_fssle
78 | knife node run_list add "www.fssle.com" www_fssle
79 |
80 | knife cookbook site vendor apt -o `pwd`/cookbooks/
81 | knife cookbook site vendor yum -o `pwd`/cookbooks/
82 |
83 | knife cookbook bulk delete ^.+$
84 | knife cookbook upload www_fssle dev_fssle -o `pwd`/cookbooks/ -VV
85 |
86 |
87 | client
88 | ----
89 |
90 | update
91 |
92 | chef-client -l debug
93 | chef-client -i 3600 -s 600
94 |
95 | ssh root@fssle.com 'sh -c "chef-client"'
96 | ssh root@www.fssle.com 'sh -c "chef-client"'
97 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/passenger_apache2/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "passenger_apache2",
3 | "description": "Installs passenger for Apache2",
4 | "long_description": "Description\n====\n\nInstalls passenger for Apache 2.\n\nChanges\n====\n\n## v0.99.0:\n\n* Upgrade to passenger 3.0.7\n* Attributes are all \"default\"\n* Install curl development headers\n* Move PassengerMaxPoolSize to config of module instead of vhost.\n\nRequirements\n====\n\n## Platform\n\nTested on Ubuntu 10.04. Should work on any Ubuntu/Debian platforms.\n\n## Cookbooks\n\nOpscode cookbooks:\n\n* apache2\n* build-essential\n\nAttributes \n====\n\n* `passenger[:version]` - Specify the version of passenger to install.\n* `passenger[:max_pool_size]` - Sets PassengerMaxPoolSize in the Apache module config.\n* `passenger[:root_path]` - The location of the passenger gem.\n* `passenger[:module_path]` - The location of the compiled passenger apache module.\n\nUsage\n====\n\nFor example, to run a Rails application on passenger:\n\n include_recipe \"rails\"\n include_recipe \"passenger\"\n \n web_app \"myproj\" do\n docroot \"/srv/myproj/public\"\n server_name \"myproj.#{node[:domain]}\"\n server_aliases [ \"myproj\", node[:hostname] ]\n rails_env \"production\"\n end\n\nA sample config template is provided, `web_app.conf.erb`. If this is suitable for your application, add 'cookbook \"passenger\"' to the define above to use that template. Otherwise, copy the template to the cookbook where you're using `web_app`, and modify as needed. The cookbook parameter is optional, if omitted it will search the cookbook where the define is used.\n\nLicense and Author\n====\n\nAuthor:: Joshua Timberman ()\nAuthor:: Joshua Sierles ()\nAuthor:: Michael Hale ()\n\nCopyright:: 2009-2011, Opscode, Inc\nCopyright:: 2009, 37signals\nCoprighty:: 2009, Michael Hale\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
5 | "maintainer": "Opscode, Inc.",
6 | "maintainer_email": "cookbooks@opscode.com",
7 | "license": "Apache 2.0",
8 | "platforms": {
9 | "redhat": ">= 0.0.0",
10 | "centos": ">= 0.0.0",
11 | "ubuntu": ">= 0.0.0",
12 | "debian": ">= 0.0.0"
13 | },
14 | "dependencies": {
15 | "apache2": ">= 0.0.0",
16 | "build-essential": ">= 0.0.0"
17 | },
18 | "recommendations": {
19 | },
20 | "suggestions": {
21 | },
22 | "conflicting": {
23 | },
24 | "providing": {
25 | },
26 | "replacing": {
27 | },
28 | "attributes": {
29 | },
30 | "groupings": {
31 | },
32 | "recipes": {
33 | "passenger_apache2": "Installs Passenger as an Apache module",
34 | "passenger_apache2::mod_rails": "Enables Apache module configuration for passenger module"
35 | },
36 | "version": "0.99.0"
37 | }
--------------------------------------------------------------------------------
/fssle_api/definitions/fssle/postinstall.sh:
--------------------------------------------------------------------------------
1 | # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2 |
3 | date > /etc/vagrant_box_build_time
4 |
5 | # Apt-install various things necessary for Ruby, guest additions,
6 | # etc., and remove optional things to trim down the machine.
7 | apt-get -y update
8 | apt-get -y upgrade
9 | apt-get -y install linux-headers-$(uname -r) build-essential
10 | apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
11 | apt-get clean
12 |
13 | # Setup sudo to allow no-password sudo for "admin"
14 | cp /etc/sudoers /etc/sudoers.orig
15 | sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
16 | sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
17 |
18 | # Install NFS client
19 | apt-get -y install nfs-common
20 |
21 | # Install Ruby from source in /opt so that users of Vagrant
22 | # can install their own Rubies using packages or however.
23 | # We must install the 1.8.x series since Puppet doesn't support
24 | # Ruby 1.9 yet.
25 | wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p334.tar.gz
26 | tar xvzf ruby-1.8.7-p334.tar.gz
27 | cd ruby-1.8.7-p334
28 | ./configure --prefix=/opt/ruby
29 | make
30 | make install
31 | cd ..
32 | rm -rf ruby-1.8.7-p334*
33 |
34 | # Install RubyGems 1.7.2
35 | wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
36 | tar xzf rubygems-1.7.2.tgz
37 | cd rubygems-1.7.2
38 | /opt/ruby/bin/ruby setup.rb
39 | cd ..
40 | rm -rf rubygems-1.7.2*
41 |
42 | # Installing chef & Puppet
43 | /opt/ruby/bin/gem install chef --no-ri --no-rdoc
44 | /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
45 |
46 | # Add /opt/ruby/bin to the global path as the last resort so
47 | # Ruby, RubyGems, and Chef/Puppet are visible
48 | echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/vagrantruby.sh
49 |
50 | # Installing vagrant keys
51 | mkdir /home/vagrant/.ssh
52 | chmod 700 /home/vagrant/.ssh
53 | cd /home/vagrant/.ssh
54 | wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
55 | chmod 600 /home/vagrant/.ssh/authorized_keys
56 | chown -R vagrant /home/vagrant/.ssh
57 |
58 | # Installing the virtualbox guest additions
59 | VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
60 | cd /tmp
61 | wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
62 | mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
63 | sh /mnt/VBoxLinuxAdditions.run
64 | umount /mnt
65 |
66 | rm VBoxGuestAdditions_$VBOX_VERSION.iso
67 |
68 | # Remove items used for building, since they aren't needed anymore
69 | apt-get -y remove linux-headers-$(uname -r) build-essential
70 | apt-get -y autoremove
71 |
72 | # Zero out the free space to save space in the final image:
73 | dd if=/dev/zero of=/EMPTY bs=1M
74 | rm -f /EMPTY
75 |
76 | # Removing leftover leases and persistent rules
77 | echo "cleaning up dhcp leases"
78 | rm /var/lib/dhcp3/*
79 |
80 | # Make sure Udev doesn't block our network
81 | # http://6.ptmc.org/?p=164
82 | echo "cleaning up udev rules"
83 | rm /etc/udev/rules.d/70-persistent-net.rules
84 | mkdir /etc/udev/rules.d/70-persistent-net.rules
85 | rm -rf /dev/.udev/
86 | rm /lib/udev/rules.d/75-persistent-net-generator.rules
87 |
88 | echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
89 | echo "pre-up sleep 2" >> /etc/network/interfaces
90 | exit
91 |
--------------------------------------------------------------------------------
/fssle_api/definitions/fssle/preseed.cfg:
--------------------------------------------------------------------------------
1 | ## Options to set on the command line
2 | d-i debian-installer/locale string en_US.utf8
3 | d-i console-setup/ask_detect boolean false
4 | d-i console-setup/layout string USA
5 |
6 | #d-i netcfg/get_hostname string dummy
7 | d-i netcfg/get_hostname string unassigned-hostname
8 | d-i netcfg/get_domain string unassigned-domain
9 |
10 | # Continue without a default route
11 | # Not working , specify a dummy in the DHCP
12 | #d-i netcfg/no_default_route boolean
13 |
14 | d-i time/zone string UTC
15 | d-i clock-setup/utc-auto boolean true
16 | d-i clock-setup/utc boolean true
17 |
18 | d-i kbd-chooser/method select American English
19 |
20 | d-i netcfg/wireless_wep string
21 |
22 | d-i base-installer/kernel/override-image string linux-server
23 | #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24 |
25 | # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26 | d-i debconf debconf/frontend select Noninteractive
27 |
28 | d-i pkgsel/install-language-support boolean false
29 | tasksel tasksel/first multiselect standard, ubuntu-server
30 |
31 | #d-i partman-auto/method string regular
32 | d-i partman-auto/method string lvm
33 | #d-i partman-auto/purge_lvm_from_device boolean true
34 |
35 | d-i partman-lvm/confirm boolean true
36 | d-i partman-lvm/device_remove_lvm boolean true
37 | d-i partman-auto/choose_recipe select atomic
38 |
39 | d-i partman/confirm_write_new_label boolean true
40 | d-i partman/confirm_nooverwrite boolean true
41 | d-i partman/choose_partition select finish
42 | d-i partman/confirm boolean true
43 |
44 | #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45 | #Message: "write the changes to disk and configure lvm preseed"
46 | #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47 | #preseed partman-lvm/confirm_nooverwrite boolean true
48 |
49 | # Write the changes to disks and configure LVM?
50 | d-i partman-lvm/confirm boolean true
51 | d-i partman-lvm/confirm_nooverwrite boolean true
52 | d-i partman-auto-lvm/guided_size string max
53 |
54 | ## Default user, we can get away with a recipe to change this
55 | d-i passwd/user-fullname string vagrant
56 | d-i passwd/username string vagrant
57 | d-i passwd/user-password password vagrant
58 | d-i passwd/user-password-again password vagrant
59 | d-i user-setup/encrypt-home boolean false
60 | d-i user-setup/allow-password-weak boolean true
61 |
62 | ## minimum is puppet and ssh and ntp
63 | # Individual additional packages to install
64 | d-i pkgsel/include string openssh-server ntp
65 |
66 | # Whether to upgrade packages after debootstrap.
67 | # Allowed values: none, safe-upgrade, full-upgrade
68 | d-i pkgsel/upgrade select full-upgrade
69 |
70 | d-i grub-installer/only_debian boolean true
71 | d-i grub-installer/with_other_os boolean true
72 | d-i finish-install/reboot_in_progress note
73 |
74 | #For the update
75 | d-i pkgsel/update-policy select none
76 |
77 | # debconf-get-selections --install
78 | #Use mirror
79 | #d-i apt-setup/use_mirror boolean true
80 | #d-i mirror/country string manual
81 | #choose-mirror-bin mirror/protocol string http
82 | #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83 | #choose-mirror-bin mirror/http/directory string /ubuntu
84 | #choose-mirror-bin mirror/suite select maverick
85 | #d-i debian-installer/allow_unauthenticated string true
86 |
87 | choose-mirror-bin mirror/http/proxy string
88 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/mod_auth_openid.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: mod_auth_openid
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | openid_dev_pkgs = value_for_platform(
21 | ["ubuntu","debian"] => { "default" => %w{ g++ apache2-prefork-dev libopkele-dev libopkele3 } },
22 | ["centos","redhat","scientific","fedora"] => {
23 | "default" => %w{ gcc-c++ httpd-devel curl-devel libtidy libtidy-devel sqlite-devel pcre-devel openssl-devel make }
24 | },
25 | "arch" => { "default" => ["libopkele"] }
26 | )
27 |
28 | case node[:platform]
29 | when "arch"
30 | include_recipe "pacman"
31 | package "tidyhtml"
32 | end
33 |
34 | openid_dev_pkgs.each do |pkg|
35 | case node[:platform]
36 | when "arch"
37 | pacman_aur pkg do
38 | action [:build, :install]
39 | end
40 | else
41 | package pkg
42 | end
43 | end
44 |
45 | case node[:platform]
46 | when "redhat", "centos", "scientific", "fedora"
47 | remote_file "#{Chef::Config[:file_cache_path]}/libopkele-2.0.4.tar.gz" do
48 | source "http://kin.klever.net/dist/libopkele-2.0.4.tar.gz"
49 | mode 0644
50 | end
51 |
52 | bash "install libopkele" do
53 | cwd "#{Chef::Config[:file_cache_path]}"
54 | # Ruby 1.8.6 does not have rpartition, unfortunately
55 | syslibdir = node[:apache][:lib_dir][0..node[:apache][:lib_dir].rindex("/")]
56 | code <<-EOH
57 | tar zxvf libopkele-2.0.4.tar.gz
58 | cd libopkele-2.0.4 && ./configure --prefix=/usr --libdir=#{syslibdir}
59 | make && make install
60 | EOH
61 | not_if { File.exists?("#{syslibdir}/libopkele.a") }
62 | end
63 | end
64 |
65 | remote_file "#{Chef::Config[:file_cache_path]}/mod_auth_openid-0.4.tar.gz" do
66 | source "http://butterfat.net/releases/mod_auth_openid/mod_auth_openid-0.4.tar.gz"
67 | mode 0644
68 | end
69 |
70 | bash "install mod_auth_openid" do
71 | cwd Chef::Config[:file_cache_path]
72 | code <<-EOH
73 | tar zxvf mod_auth_openid-0.4.tar.gz
74 | cd mod_auth_openid-0.4 && ./configure
75 | perl -pi -e "s/-i -a -n 'authopenid'/-i -n 'authopenid'/g" Makefile
76 | make && make install
77 | EOH
78 | not_if { ::File.exists?("#{node[:apache][:lib_dir]}/modules/mod_auth_openid.so") }
79 | end
80 |
81 | file "#{node[:apache][:cache_dir]}/mod_auth_openid.db" do
82 | owner "root"
83 | group node[:apache][:group]
84 | mode 0640
85 | end
86 |
87 | template "#{node[:apache][:dir]}/mods-available/authopenid.load" do
88 | source "mods/authopenid.load.erb"
89 | owner "root"
90 | group "root"
91 | mode 0644
92 | end
93 |
94 | apache_module "authopenid" do
95 | filename "mod_auth_openid.so"
96 | end
97 |
98 | template "/usr/local/bin/mod_auth_openid.rb" do
99 | source "mod_auth_openid.rb.erb"
100 | owner "root"
101 | group node[:apache][:group]
102 | mode 0750
103 | end
104 |
--------------------------------------------------------------------------------
/vagrant_demo/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant::Config.run do |config|
2 | # All Vagrant configuration is done here. The most common configuration
3 | # options are documented and commented below. For a complete reference,
4 | # please see the online documentation at vagrantup.com.
5 |
6 | # Every Vagrant virtual environment requires a box to build off of.
7 | config.vm.box = "fssle"
8 |
9 | # The url from where the 'config.vm.box' box will be fetched if it
10 | # doesn't already exist on the user's system.
11 | # config.vm.box_url = "http://domain.com/path/to/above.box"
12 |
13 | # Boot with a GUI so you can see the screen. (Default is headless)
14 | config.vm.boot_mode = :gui
15 |
16 | # Assign this VM to a host only network IP, allowing you to access it
17 | # via the IP.
18 | # config.vm.network "33.33.33.10"
19 |
20 | # Forward a port from the guest to the host, which allows for outside
21 | # computers to access the VM, whereas host only networking does not.
22 | config.vm.forward_port "http", 80, 8080
23 |
24 | # Share an additional folder to the guest VM. The first argument is
25 | # an identifier, the second is the path on the guest to mount the
26 | # folder, and the third is the path on the host to the actual folder.
27 | # config.vm.share_folder "v-data", "/vagrant_data", "../data"
28 |
29 | # Enable provisioning with Puppet stand alone. Puppet manifests
30 | # are contained in a directory path relative to this Vagrantfile.
31 | # You will need to create the manifests directory and a manifest in
32 | # the file fssle.pp in the manifests_path directory.
33 | #
34 | # An example Puppet manifest to provision the message of the day:
35 | #
36 | # # group { "puppet":
37 | # # ensure => "present",
38 | # # }
39 | # #
40 | # # File { owner => 0, group => 0, mode => 0644 }
41 | # #
42 | # # file { '/etc/motd':
43 | # # content => "Welcome to your Vagrant-built virtual machine!
44 | # # Managed by Puppet.\n"
45 | # # }
46 | #
47 | # config.vm.provision :puppet do |puppet|
48 | # puppet.manifests_path = "manifests"
49 | # puppet.manifest_file = "fssle.pp"
50 | # end
51 |
52 | # Enable provisioning with chef solo, specifying a cookbooks path (relative
53 | # to this Vagrantfile), and adding some recipes and/or roles.
54 | #
55 | config.vm.provision :chef_solo do |chef|
56 | chef.cookbooks_path = "../fssle_api/cookbooks"
57 | #chef.add_recipe "mysql"
58 | chef.roles_path = "../fssle_api/roles"
59 | chef.add_role "fssle"
60 |
61 | # # You may also specify custom JSON attributes:
62 | # chef.json = { :mysql_password => "foo" }
63 | end
64 |
65 | # Enable provisioning with chef server, specifying the chef server URL,
66 | # and the path to the validation key (relative to this Vagrantfile).
67 | #
68 | # The Opscode Platform uses HTTPS. Substitute your organization for
69 | # ORGNAME in the URL and validation key.
70 | #
71 | # If you have your own Chef Server, use the appropriate URL, which may be
72 | # HTTP instead of HTTPS depending on your configuration. Also change the
73 | # validation key to validation.pem.
74 | #
75 | # config.vm.provision :chef_client do |chef|
76 | # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
77 | # chef.validation_key_path = "ORGNAME-validator.pem"
78 | # end
79 | #
80 | # If you're using the Opscode platform, your validator client is
81 | # ORGNAME-validator, replacing ORGNAME with your organization name.
82 | #
83 | # IF you have your own Chef Server, the default validation client name is
84 | # chef-validator, unless you changed the configuration.
85 | #
86 | # chef.validation_client_name = "ORGNAME-validator"
87 | end
88 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/autoindex.conf.erb:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Directives controlling the display of server-generated directory listings.
4 | #
5 |
6 | #
7 | # IndexOptions: Controls the appearance of server-generated directory
8 | # listings.
9 | # Remove/replace the "Charset=UTF-8" if you don't use UTF-8 for your filenames.
10 | #
11 | IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=* DescriptionWidth=* Charset=UTF-8
12 |
13 | #
14 | # AddIcon* directives tell the server which icon to show for different
15 | # files or filename extensions. These are only displayed for
16 | # FancyIndexed directories.
17 | #
18 | AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip x-bzip2
19 |
20 | AddIconByType (TXT,/icons/text.gif) text/*
21 | AddIconByType (IMG,/icons/image2.gif) image/*
22 | AddIconByType (SND,/icons/sound2.gif) audio/*
23 | AddIconByType (VID,/icons/movie.gif) video/*
24 |
25 | AddIcon /icons/binary.gif .bin .exe
26 | AddIcon /icons/binhex.gif .hqx
27 | AddIcon /icons/tar.gif .tar
28 | AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
29 | AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
30 | AddIcon /icons/a.gif .ps .ai .eps
31 | AddIcon /icons/layout.gif .html .shtml .htm .pdf
32 | AddIcon /icons/text.gif .txt
33 | AddIcon /icons/c.gif .c
34 | AddIcon /icons/p.gif .pl .py
35 | AddIcon /icons/f.gif .for
36 | AddIcon /icons/dvi.gif .dvi
37 | AddIcon /icons/uuencoded.gif .uu
38 | AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
39 | AddIcon /icons/tex.gif .tex
40 | # It's a suffix rule, so simply matching "core" matches "score" as well !
41 | AddIcon /icons/bomb.gif /core
42 | AddIcon (SND,/icons/sound2.gif) .ogg
43 | AddIcon (VID,/icons/movie.gif) .ogm
44 |
45 | AddIcon /icons/back.gif ..
46 | AddIcon /icons/hand.right.gif README
47 | AddIcon /icons/folder.gif ^^DIRECTORY^^
48 | AddIcon /icons/blank.gif ^^BLANKICON^^
49 |
50 | # Default icons for OpenDocument format
51 | AddIcon /icons/odf6odt-20x22.png .odt
52 | AddIcon /icons/odf6ods-20x22.png .ods
53 | AddIcon /icons/odf6odp-20x22.png .odp
54 | AddIcon /icons/odf6odg-20x22.png .odg
55 | AddIcon /icons/odf6odc-20x22.png .odc
56 | AddIcon /icons/odf6odf-20x22.png .odf
57 | AddIcon /icons/odf6odb-20x22.png .odb
58 | AddIcon /icons/odf6odi-20x22.png .odi
59 | AddIcon /icons/odf6odm-20x22.png .odm
60 |
61 | AddIcon /icons/odf6ott-20x22.png .ott
62 | AddIcon /icons/odf6ots-20x22.png .ots
63 | AddIcon /icons/odf6otp-20x22.png .otp
64 | AddIcon /icons/odf6otg-20x22.png .otg
65 | AddIcon /icons/odf6otc-20x22.png .otc
66 | AddIcon /icons/odf6otf-20x22.png .otf
67 | AddIcon /icons/odf6oti-20x22.png .oti
68 | AddIcon /icons/odf6oth-20x22.png .oth
69 |
70 | #
71 | # DefaultIcon is which icon to show for files which do not have an icon
72 | # explicitly set.
73 | #
74 | DefaultIcon /icons/unknown.gif
75 |
76 | #
77 | # AddDescription allows you to place a short description after a file in
78 | # server-generated indexes. These are only displayed for FancyIndexed
79 | # directories.
80 | # Format: AddDescription "description" filename
81 | #
82 | #AddDescription "GZIP compressed document" .gz
83 | #AddDescription "tar archive" .tar
84 | #AddDescription "GZIP compressed tar archive" .tgz
85 |
86 | #
87 | # ReadmeName is the name of the README file the server will look for by
88 | # default, and append to directory listings.
89 | #
90 | # HeaderName is the name of a file which should be prepended to
91 | # directory indexes.
92 | ReadmeName README.html
93 | HeaderName HEADER.html
94 |
95 | #
96 | # IndexIgnore is a set of filenames which directory indexing should ignore
97 | # and not include in the listing. Shell-style wildcarding is permitted.
98 | #
99 | IndexIgnore .??* *~ *# RCS CVS *,v *,t
100 |
101 |
102 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/attributes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Attributes:: apache
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | # Where the various parts of apache are
21 | case platform
22 | when "redhat","centos","scientific","fedora","suse"
23 | set[:apache][:dir] = "/etc/httpd"
24 | set[:apache][:log_dir] = "/var/log/httpd"
25 | set[:apache][:user] = "apache"
26 | set[:apache][:group] = "apache"
27 | set[:apache][:binary] = "/usr/sbin/httpd"
28 | set[:apache][:icondir] = "/var/www/icons/"
29 | set[:apache][:cache_dir] = "/var/cache/httpd"
30 | if node.platform_version.to_f >= 6 then
31 | set[:apache][:pid_file] = "/var/run/httpd/httpd.pid"
32 | else
33 | set[:apache][:pid_file] = "/var/run/httpd.pid"
34 | end
35 | set[:apache][:lib_dir] = node[:kernel][:machine] =~ /^i[36]86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
36 | when "debian","ubuntu"
37 | set[:apache][:dir] = "/etc/apache2"
38 | set[:apache][:log_dir] = "/var/log/apache2"
39 | set[:apache][:user] = "www-data"
40 | set[:apache][:group] = "www-data"
41 | set[:apache][:binary] = "/usr/sbin/apache2"
42 | set[:apache][:icondir] = "/usr/share/apache2/icons"
43 | set[:apache][:cache_dir] = "/var/cache/apache2"
44 | set[:apache][:pid_file] = "/var/run/apache2.pid"
45 | set[:apache][:lib_dir] = "/usr/lib/apache2"
46 | when "arch"
47 | set[:apache][:dir] = "/etc/httpd"
48 | set[:apache][:log_dir] = "/var/log/httpd"
49 | set[:apache][:user] = "http"
50 | set[:apache][:group] = "http"
51 | set[:apache][:binary] = "/usr/sbin/httpd"
52 | set[:apache][:icondir] = "/usr/share/httpd/icons"
53 | set[:apache][:cache_dir] = "/var/cache/httpd"
54 | set[:apache][:pid_file] = "/var/run/httpd/httpd.pid"
55 | set[:apache][:lib_dir] = "/usr/lib/httpd"
56 | else
57 | set[:apache][:dir] = "/etc/apache2"
58 | set[:apache][:log_dir] = "/var/log/apache2"
59 | set[:apache][:user] = "www-data"
60 | set[:apache][:group] = "www-data"
61 | set[:apache][:binary] = "/usr/sbin/apache2"
62 | set[:apache][:icondir] = "/usr/share/apache2/icons"
63 | set[:apache][:cache_dir] = "/var/cache/apache2"
64 | set[:apache][:pid_file] = "logs/httpd.pid"
65 | set[:apache][:lib_dir] = "/usr/lib/apache2"
66 | end
67 |
68 | ###
69 | # These settings need the unless, since we want them to be tunable,
70 | # and we don't want to override the tunings.
71 | ###
72 |
73 | # General settings
74 | default[:apache][:listen_ports] = [ "80","443" ]
75 | default[:apache][:contact] = "ops@example.com"
76 | default[:apache][:timeout] = 300
77 | default[:apache][:keepalive] = "On"
78 | default[:apache][:keepaliverequests] = 100
79 | default[:apache][:keepalivetimeout] = 5
80 |
81 | # Security
82 | default[:apache][:servertokens] = "Prod"
83 | default[:apache][:serversignature] = "On"
84 | default[:apache][:traceenable] = "On"
85 |
86 | # mod_auth_openids
87 | default[:apache][:allowed_openids] = Array.new
88 |
89 | # Prefork Attributes
90 | default[:apache][:prefork][:startservers] = 16
91 | default[:apache][:prefork][:minspareservers] = 16
92 | default[:apache][:prefork][:maxspareservers] = 32
93 | default[:apache][:prefork][:serverlimit] = 400
94 | default[:apache][:prefork][:maxclients] = 400
95 | default[:apache][:prefork][:maxrequestsperchild] = 10000
96 |
97 | # Worker Attributes
98 | default[:apache][:worker][:startservers] = 4
99 | default[:apache][:worker][:maxclients] = 1024
100 | default[:apache][:worker][:minsparethreads] = 64
101 | default[:apache][:worker][:maxsparethreads] = 192
102 | default[:apache][:worker][:threadsperchild] = 64
103 | default[:apache][:worker][:maxrequestsperchild] = 0
104 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/README.md:
--------------------------------------------------------------------------------
1 | Description
2 | ===========
3 |
4 | This cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date or manage apt-cacher and cacher clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d.
5 |
6 | Recipes
7 | =======
8 |
9 | default
10 | -------
11 |
12 | This recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is less than one day old.
13 |
14 | This recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.
15 |
16 | This recipe also sets up a local cache directory for preseeding packages.
17 |
18 | cacher
19 | ------
20 |
21 | Installs the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the `cacher-client` recipe, so it helps seed itself.
22 |
23 | cacher-client
24 | -------------
25 | Configures the node to use the apt-cacher server as a client.
26 |
27 | Resources/Providers
28 | ===================
29 |
30 | This LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource.
31 |
32 | # Actions
33 |
34 | - :add: creates a repository file and builds the repository listing
35 | - :remove: removes the repository file
36 |
37 | # Attribute Parameters
38 |
39 | - repo_name: name attribute. The name of the channel to discover
40 | - uri: the base of the Debian distribution
41 | - distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`
42 | - components: package groupings..when it doubt use `main`
43 | - deb_src: whether or not to add the repository as a source repo as well
44 | - key_server: the GPG keyserver where the key for the repo should be retrieved
45 | - key: if a `key_server` is provided, this is assumed to be the fingerprint, otherwise it is the URI to the GPG key for the repo
46 |
47 | # Examples
48 |
49 | # add the Zenoss repo
50 | apt_repository "zenoss" do
51 | uri "http://dev.zenoss.org/deb"
52 | components ["main","stable"]
53 | action :add
54 | end
55 |
56 | # add the Nginx PPA; grab key from keyserver
57 | apt_repository "nginx-php" do
58 | uri "http://ppa.launchpad.net/nginx/php5/ubuntu"
59 | distribution node['lsb']['codename']
60 | components ["main"]
61 | keyserver "keyserver.ubuntu.com"
62 | key "C300EE8C"
63 | action :add
64 | end
65 |
66 | # add the Cloudkick Repo
67 | apt_repository "cloudkick" do
68 | uri "http://packages.cloudkick.com/ubuntu"
69 | distribution node['lsb']['codename']
70 | components ["main"]
71 | key "http://packages.cloudkick.com/cloudkick.packages.key"
72 | action :add
73 | end
74 |
75 | # remove Zenoss repo
76 | apt_repository "zenoss" do
77 | action :remove
78 | end
79 |
80 | Usage
81 | =====
82 |
83 | Put `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:
84 |
85 | template "/etc/apt/sources.list.d/my_apt_sources.list" do
86 | notifies :run, resources(:execute => "apt-get update"), :immediately
87 | end
88 |
89 | The above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.
90 |
91 | Put `recipe[apt::cacher]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.
92 |
93 | Changes
94 | =======
95 |
96 | ## v1.2.0:
97 |
98 | * COOK-136: Limit apt-get update to one run per day unless notified.
99 | * COOK-471: ignore failure on apt-get update
100 | * COOK-533: add support for deb and `deb_src` repos with `apt_repository`
101 |
102 | License and Author
103 | ==================
104 |
105 | Author:: Joshua Timberman ()
106 | Author:: Matt Ray ()
107 | Author:: Seth Chisamore ()
108 |
109 | Copyright 2009-2011 Opscode, Inc.
110 |
111 | Licensed under the Apache License, Version 2.0 (the "License");
112 | you may not use this file except in compliance with the License.
113 | You may obtain a copy of the License at
114 |
115 | http://www.apache.org/licenses/LICENSE-2.0
116 |
117 | Unless required by applicable law or agreed to in writing, software
118 | distributed under the License is distributed on an "AS IS" BASIS,
119 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120 | See the License for the specific language governing permissions and
121 | limitations under the License.
122 |
123 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "apt",
3 | "description": "Configures apt and apt services and an LWRP for managing apt repositories",
4 | "long_description": "Description\n===========\n\nThis cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date or manage apt-cacher and cacher clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d.\n\nRecipes\n=======\n\ndefault\n-------\n\nThis recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is less than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\ncacher\n------\n\nInstalls the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the `cacher-client` recipe, so it helps seed itself.\n\ncacher-client\n-------------\nConfigures the node to use the apt-cacher server as a client.\n\nResources/Providers\n===================\n\nThis LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource.\n\n# Actions\n\n- :add: creates a repository file and builds the repository listing\n- :remove: removes the repository file\n\n# Attribute Parameters\n\n- repo_name: name attribute. The name of the channel to discover\n- uri: the base of the Debian distribution\n- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`\n- components: package groupings..when it doubt use `main`\n- deb_src: whether or not to add the repository as a source repo as well\n- key_server: the GPG keyserver where the key for the repo should be retrieved\n- key: if a `key_server` is provided, this is assumed to be the fingerprint, otherwise it is the URI to the GPG key for the repo\n\n# Examples\n\n # add the Zenoss repo\n apt_repository \"zenoss\" do\n uri \"http://dev.zenoss.org/deb\"\n components [\"main\",\"stable\"]\n action :add\n end\n \n # add the Nginx PPA; grab key from keyserver\n apt_repository \"nginx-php\" do\n uri \"http://ppa.launchpad.net/nginx/php5/ubuntu\"\n distribution node['lsb']['codename']\n components [\"main\"]\n keyserver \"keyserver.ubuntu.com\"\n key \"C300EE8C\"\n action :add\n end\n \n # add the Cloudkick Repo\n apt_repository \"cloudkick\" do\n uri \"http://packages.cloudkick.com/ubuntu\"\n distribution node['lsb']['codename']\n components [\"main\"]\n key \"http://packages.cloudkick.com/cloudkick.packages.key\"\n action :add\n end\n \n # remove Zenoss repo\n apt_repository \"zenoss\" do\n action :remove\n end\n \nUsage\n=====\n\nPut `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:\n\n template \"/etc/apt/sources.list.d/my_apt_sources.list\" do\n notifies :run, resources(:execute => \"apt-get update\"), :immediately\n end\n\nThe above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.\n\nPut `recipe[apt::cacher]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.\n\nChanges\n=======\n\n## v1.2.0:\n\n* COOK-136: Limit apt-get update to one run per day unless notified.\n* COOK-471: ignore failure on apt-get update\n* COOK-533: add support for deb and `deb_src` repos with `apt_repository`\n\nLicense and Author\n==================\n\nAuthor:: Joshua Timberman ()\nAuthor:: Matt Ray ()\nAuthor:: Seth Chisamore ()\n\nCopyright 2009-2011 Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n",
5 | "maintainer": "Opscode, Inc.",
6 | "maintainer_email": "cookbooks@opscode.com",
7 | "license": "Apache 2.0",
8 | "platforms": {
9 | "ubuntu": ">= 0.0.0",
10 | "debian": ">= 0.0.0"
11 | },
12 | "dependencies": {
13 | },
14 | "recommendations": {
15 | },
16 | "suggestions": {
17 | },
18 | "conflicting": {
19 | },
20 | "providing": {
21 | },
22 | "replacing": {
23 | },
24 | "attributes": {
25 | },
26 | "groupings": {
27 | },
28 | "recipes": {
29 | "apt": "Runs apt-get update during compile phase and sets up preseed directories",
30 | "apt::cacher": "Set up an APT cache",
31 | "apt::cacher-client": "Client for the apt::cacher server"
32 | },
33 | "version": "1.2.0"
34 | }
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/recipes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: apache2
3 | # Recipe:: default
4 | #
5 | # Copyright 2008-2009, Opscode, Inc.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | package "apache2" do
21 | case node[:platform]
22 | when "redhat","centos","scientific","fedora","suse"
23 | package_name "httpd"
24 | when "debian","ubuntu"
25 | package_name "apache2"
26 | when "arch"
27 | package_name "apache"
28 | end
29 | action :install
30 | end
31 |
32 | service "apache2" do
33 | case node[:platform]
34 | when "redhat","centos","scientific","fedora","suse"
35 | service_name "httpd"
36 | # If restarted/reloaded too quickly httpd has a habit of failing.
37 | # This may happen with multiple recipes notifying apache to restart - like
38 | # during the initial bootstrap.
39 | restart_command "/sbin/service httpd restart && sleep 1"
40 | reload_command "/sbin/service httpd reload && sleep 1"
41 | when "debian","ubuntu"
42 | service_name "apache2"
43 | restart_command "/usr/sbin/invoke-rc.d apache2 restart && sleep 1"
44 | reload_command "/usr/sbin/invoke-rc.d apache2 reload && sleep 1"
45 | when "arch"
46 | service_name "httpd"
47 | end
48 | supports value_for_platform(
49 | "debian" => { "4.0" => [ :restart, :reload ], "default" => [ :restart, :reload, :status ] },
50 | "ubuntu" => { "default" => [ :restart, :reload, :status ] },
51 | "redhat" => { "default" => [ :restart, :reload, :status ] },
52 | "centos" => { "default" => [ :restart, :reload, :status ] },
53 | "scientific" => { "default" => [ :restart, :reload, :status ] },
54 | "fedora" => { "default" => [ :restart, :reload, :status ] },
55 | "arch" => { "default" => [ :restart, :reload, :status ] },
56 | "suse" => { "default" => [ :restart, :reload, :status ] },
57 | "default" => { "default" => [:restart, :reload ] }
58 | )
59 | action :enable
60 | end
61 |
62 | if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse" )
63 | directory node[:apache][:log_dir] do
64 | mode 0755
65 | action :create
66 | end
67 |
68 | package "perl"
69 |
70 | cookbook_file "/usr/local/bin/apache2_module_conf_generate.pl" do
71 | source "apache2_module_conf_generate.pl"
72 | mode 0755
73 | owner "root"
74 | group "root"
75 | end
76 |
77 | %w{sites-available sites-enabled mods-available mods-enabled}.each do |dir|
78 | directory "#{node[:apache][:dir]}/#{dir}" do
79 | mode 0755
80 | owner "root"
81 | group "root"
82 | action :create
83 | end
84 | end
85 |
86 | execute "generate-module-list" do
87 | if node[:kernel][:machine] == "x86_64"
88 | libdir = value_for_platform("arch" => { "default" => "lib" }, "default" => "lib64")
89 | else
90 | libdir = "lib"
91 | end
92 | command "/usr/local/bin/apache2_module_conf_generate.pl /usr/#{libdir}/httpd/modules /etc/httpd/mods-available"
93 | action :run
94 | end
95 |
96 | %w{a2ensite a2dissite a2enmod a2dismod}.each do |modscript|
97 | template "/usr/sbin/#{modscript}" do
98 | source "#{modscript}.erb"
99 | mode 0755
100 | owner "root"
101 | group "root"
102 | end
103 | end
104 |
105 | # installed by default on centos/rhel, remove in favour of mods-enabled
106 | %w{ proxy_ajp auth_pam authz_ldap webalizer ssl welcome }.each do |f|
107 | file "#{node[:apache][:dir]}/conf.d/#{f}.conf" do
108 | action :delete
109 | backup false
110 | end
111 | end
112 |
113 | # installed by default on centos/rhel, remove in favour of mods-enabled
114 | file "#{node[:apache][:dir]}/conf.d/README" do
115 | action :delete
116 | backup false
117 | end
118 | end
119 |
120 | directory "#{node[:apache][:dir]}/ssl" do
121 | action :create
122 | mode 0755
123 | owner "root"
124 | group "root"
125 | end
126 |
127 | directory "#{node[:apache][:dir]}/conf.d" do
128 | action :create
129 | mode 0755
130 | owner "root"
131 | group "root"
132 | end
133 |
134 | directory node[:apache][:cache_dir] do
135 | action :create
136 | mode 0755
137 | owner "root"
138 | group "root"
139 | end
140 |
141 | template "apache2.conf" do
142 | case node[:platform]
143 | when "redhat", "centos", "scientific", "fedora", "arch"
144 | path "#{node[:apache][:dir]}/conf/httpd.conf"
145 | when "debian","ubuntu"
146 | path "#{node[:apache][:dir]}/apache2.conf"
147 | end
148 | source "apache2.conf.erb"
149 | owner "root"
150 | group "root"
151 | mode 0644
152 | notifies :restart, resources(:service => "apache2")
153 | end
154 |
155 | template "security" do
156 | path "#{node[:apache][:dir]}/conf.d/security"
157 | source "security.erb"
158 | owner "root"
159 | group "root"
160 | mode 0644
161 | backup false
162 | notifies :restart, resources(:service => "apache2")
163 | end
164 |
165 | template "charset" do
166 | path "#{node[:apache][:dir]}/conf.d/charset"
167 | source "charset.erb"
168 | owner "root"
169 | group "root"
170 | mode 0644
171 | backup false
172 | notifies :restart, resources(:service => "apache2")
173 | end
174 |
175 | template "#{node[:apache][:dir]}/ports.conf" do
176 | source "ports.conf.erb"
177 | owner "root"
178 | group "root"
179 | variables :apache_listen_ports => node[:apache][:listen_ports].map{|p| p.to_i}.uniq
180 | mode 0644
181 | notifies :restart, resources(:service => "apache2")
182 | end
183 |
184 | template "#{node[:apache][:dir]}/sites-available/default" do
185 | source "default-site.erb"
186 | owner "root"
187 | group "root"
188 | mode 0644
189 | notifies :restart, resources(:service => "apache2")
190 | end
191 |
192 | include_recipe "apache2::mod_status"
193 | include_recipe "apache2::mod_alias"
194 | include_recipe "apache2::mod_auth_basic"
195 | include_recipe "apache2::mod_authn_file"
196 | include_recipe "apache2::mod_authz_default"
197 | include_recipe "apache2::mod_authz_groupfile"
198 | include_recipe "apache2::mod_authz_host"
199 | include_recipe "apache2::mod_authz_user"
200 | include_recipe "apache2::mod_autoindex"
201 | include_recipe "apache2::mod_dir"
202 | include_recipe "apache2::mod_env"
203 | include_recipe "apache2::mod_mime"
204 | include_recipe "apache2::mod_negotiation"
205 | include_recipe "apache2::mod_setenvif"
206 | include_recipe "apache2::mod_log_config" if platform?("redhat", "centos", "scientific", "fedora", "suse", "arch")
207 |
208 | apache_site "default" if platform?("redhat", "centos", "scientific", "fedora")
209 |
210 | service "apache2" do
211 | action :start
212 | end
213 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aws",
3 | "description": "LWRPs for managing AWS resources",
4 | "long_description": "Description\n===========\n\nThis cookbook provides libraries, resources and providers to configure and manage Amazon Web Services components and offerings with the EC2 API. Currently supported resources:\n\n* EBS Volumes (`ebs_volume`)\n* Elastic IPs (`elastic_ip`)\n\n---\nRequirements\n============\n\nRequires Chef 0.7.10 or higher for Lightweight Resource and Provider support. Chef 0.8+ is recommended. While this cookbook can be used in `chef-solo` mode, to gain the most flexibility, we recommend using `chef-client` with a Chef Server.\n\nAn Amazon Web Services account is required. The Access Key and Secret Access Key are used to authenticate with EC2.\n\n---\nAWS Credentials\n===============\n\nIn order to manage AWS components, authentication credentials need to be available to the node. There are a number of ways to handle this, such as node attributes or roles. We recommend storing these in a databag (Chef 0.8+), and loading them in the recipe where the resources are needed.\n\nDataBag recommendation:\n\n % knife data bag show aws main\n {\n \"id\": \"main\",\n \"aws_access_key_id\": \"YOUR_ACCESS_KEY\",\n \"aws_secret_access_key\": \"YOUR_SECRET_ACCESS_KEY\"\n }\n\nThis can be loaded in a recipe with:\n\n aws = data_bag_item(\"aws\", \"main\")\n\nAnd to access the values:\n\n aws['aws_access_key_id']\n aws['aws_secret_access_key']\n\nWe'll look at specific usage below.\n\n---\nRecipes\n=======\n\ndefault.rb\n----------\n\nThe default recipe installs the `right_aws` RubyGem, which this cookbook requires in order to work with the EC2 API. Make sure that the aws recipe is in the node or role `run_list` before any resources from this cookbook are used.\n\n \"run_list\": [\n \"recipe[aws]\"\n ]\n\nThe `gem_package` is created as a Ruby Object and thus installed during the Compile Phase of the Chef run.\n\n---\nLibraries\n=========\n\nThe cookbook has a library module, `Opscode::AWS::Ec2`, which can be included where necessary:\n\n include Opscode::Aws::Ec2\n\nThis is needed in any providers in the cookbook. Along with some helper methods used in the providers, it sets up a class variable, `ec2` that is used along with the access and secret access keys\n\n---\nResources and Providers\n=======================\n\nThis cookbook provides two resources and corresponding providers.\n\n`ebs_volume.rb`\n-------------\n\nManage Elastic Block Store (EBS) volumes with this resource.\n\nActions:\n\n* `create` - create a new volume.\n* `attach` - attach the specified volume.\n* `detach` - detach the specified volume.\n* `snapshot` - create a snapshot of the volume.\n* `prune` - prune snapshots.\n\nAttribute Parameters:\n\n* `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.\n* `size` - size of the volume in gigabytes.\n* `snapshot_id` - snapshot to build EBS volume from.\n* `availability_zone` - EC2 region, and is normally automatically detected.\n* `device` - local block device to attach the volume to, e.g. `/dev/sdi` but no default value, required.\n* `volume_id` - specify an ID to attach, cannot be used with action `:create` because AWS assigns new volume IDs\n* `timeout` - connection timeout for EC2 API.\n* `snapshots_to_keep` - used with action `:prune` for number of snapshots to maintain.\n\n`elastic_ip.rb`\n-------------\n\nActions:\n\n* `associate` - associate the IP.\n* `disassociate` - disassociate the IP.\n\nAttribute Parameters:\n\n* `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.\n* `ip` - the IP address.\n* `timeout` - connection timeout for EC2 API.\n\n\n---\nUsage\n=====\n\nFor both the `ebs_volume` and `elastic_ip` resources, put the following at the top of the recipe where they are used.\n\n include_recipe \"aws\"\n aws = data_bag_item(\"aws\", \"main\")\n\naws_ebs_volume\n--------------\n\nThe resource only handles manipulating the EBS volume, additional resources need to be created in the recipe to manage the attached volume as a filesystem or logical volume.\n\n aws_ebs_volume \"db_ebs_volume\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n size 50\n device \"/dev/sdi\"\n action [ :create, :attach ]\n end\n\nThis will create a 50G volume, attach it to the instance as `/dev/sdi`.\n\n aws_ebs_volume \"db_ebs_volume_from_snapshot\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n size 50\n device \"/dev/sdi\"\n snapshot_id \"snap-ABCDEFGH\"\n action [ :create, :attach ]\n end\n\nThis will create a new 50G volume from the snapshot ID provided and attach it as `/dev/sdi`.\n\naws_elastic_ip\n--------------\n\nThe `elastic_ip` resource provider does not support allocating new IPs. This must be done before running a recipe that uses the resource. After allocating a new Elastic IP, we recommend storing it in a databag and loading the item in the recipe.\n\nDatabag structure:\n\n % knife data bag show aws eip_load_balancer_production\n {\n \"id\": \"eip_load_balancer_production\",\n \"public_ip\": \"YOUR_ALLOCATED_IP\"\n }\n\nThen to set up the Elastic IP on a system:\n\n ip_info = data_bag_item(\"aws\", \"eip_load_balancer_production\")\n\n aws_elastic_ip \"eip_load_balancer_production\" do\n aws_access_key aws['aws_access_key_id']\n aws_secret_access_key aws['aws_secret_access_key']\n lb ip_info['public_ip']\n action :associate\n end\n\nThis will use the loaded `aws` and `ip_info` databags to pass the required values into the resource to configure. Note that when associating an Elastic IP to an instance, connectivity to the instance will be lost because the public IP address is changed. You will need to reconnect to the instance with the new IP.\n\nYou can also store this in a role as an attribute or assign to the node directly, if preferred.\n\n---\nLicense and Author\n==================\n\nAuthor:: Chris Walters ()\nAuthor:: AJ Christensen ()\n\nCopyright 2009-2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
5 | "maintainer": "Opscode, Inc.",
6 | "maintainer_email": "cookbooks@opscode.com",
7 | "license": "Apache 2.0",
8 | "platforms": {
9 | },
10 | "dependencies": {
11 | },
12 | "recommendations": {
13 | },
14 | "suggestions": {
15 | },
16 | "conflicting": {
17 | },
18 | "providing": {
19 | },
20 | "replacing": {
21 | },
22 | "attributes": {
23 | },
24 | "groupings": {
25 | },
26 | "recipes": {
27 | "aws": "Installs the right_aws gem during compile time"
28 | },
29 | "version": "0.99.0"
30 | }
--------------------------------------------------------------------------------
/fssle_api/cookbooks/aws/README.md:
--------------------------------------------------------------------------------
1 | Description
2 | ===========
3 |
4 | This cookbook provides libraries, resources and providers to configure and manage Amazon Web Services components and offerings with the EC2 API. Currently supported resources:
5 |
6 | * EBS Volumes (`ebs_volume`)
7 | * Elastic IPs (`elastic_ip`)
8 |
9 | ---
10 | Requirements
11 | ============
12 |
13 | Requires Chef 0.7.10 or higher for Lightweight Resource and Provider support. Chef 0.8+ is recommended. While this cookbook can be used in `chef-solo` mode, to gain the most flexibility, we recommend using `chef-client` with a Chef Server.
14 |
15 | An Amazon Web Services account is required. The Access Key and Secret Access Key are used to authenticate with EC2.
16 |
17 | ---
18 | AWS Credentials
19 | ===============
20 |
21 | In order to manage AWS components, authentication credentials need to be available to the node. There are a number of ways to handle this, such as node attributes or roles. We recommend storing these in a databag (Chef 0.8+), and loading them in the recipe where the resources are needed.
22 |
23 | DataBag recommendation:
24 |
25 | % knife data bag show aws main
26 | {
27 | "id": "main",
28 | "aws_access_key_id": "YOUR_ACCESS_KEY",
29 | "aws_secret_access_key": "YOUR_SECRET_ACCESS_KEY"
30 | }
31 |
32 | This can be loaded in a recipe with:
33 |
34 | aws = data_bag_item("aws", "main")
35 |
36 | And to access the values:
37 |
38 | aws['aws_access_key_id']
39 | aws['aws_secret_access_key']
40 |
41 | We'll look at specific usage below.
42 |
43 | ---
44 | Recipes
45 | =======
46 |
47 | default.rb
48 | ----------
49 |
50 | The default recipe installs the `right_aws` RubyGem, which this cookbook requires in order to work with the EC2 API. Make sure that the aws recipe is in the node or role `run_list` before any resources from this cookbook are used.
51 |
52 | "run_list": [
53 | "recipe[aws]"
54 | ]
55 |
56 | The `gem_package` is created as a Ruby Object and thus installed during the Compile Phase of the Chef run.
57 |
58 | ---
59 | Libraries
60 | =========
61 |
62 | The cookbook has a library module, `Opscode::AWS::Ec2`, which can be included where necessary:
63 |
64 | include Opscode::Aws::Ec2
65 |
66 | This is needed in any providers in the cookbook. Along with some helper methods used in the providers, it sets up a class variable, `ec2` that is used along with the access and secret access keys
67 |
68 | ---
69 | Resources and Providers
70 | =======================
71 |
72 | This cookbook provides two resources and corresponding providers.
73 |
74 | `ebs_volume.rb`
75 | -------------
76 |
77 | Manage Elastic Block Store (EBS) volumes with this resource.
78 |
79 | Actions:
80 |
81 | * `create` - create a new volume.
82 | * `attach` - attach the specified volume.
83 | * `detach` - detach the specified volume.
84 | * `snapshot` - create a snapshot of the volume.
85 | * `prune` - prune snapshots.
86 |
87 | Attribute Parameters:
88 |
89 | * `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.
90 | * `size` - size of the volume in gigabytes.
91 | * `snapshot_id` - snapshot to build EBS volume from.
92 | * `availability_zone` - EC2 region, and is normally automatically detected.
93 | * `device` - local block device to attach the volume to, e.g. `/dev/sdi` but no default value, required.
94 | * `volume_id` - specify an ID to attach, cannot be used with action `:create` because AWS assigns new volume IDs
95 | * `timeout` - connection timeout for EC2 API.
96 | * `snapshots_to_keep` - used with action `:prune` for number of snapshots to maintain.
97 |
98 | `elastic_ip.rb`
99 | -------------
100 |
101 | Actions:
102 |
103 | * `associate` - associate the IP.
104 | * `disassociate` - disassociate the IP.
105 |
106 | Attribute Parameters:
107 |
108 | * `aws_secret_access_key`, `aws_access_key` - passed to `Opscode::AWS:Ec2` to authenticate, required.
109 | * `ip` - the IP address.
110 | * `timeout` - connection timeout for EC2 API.
111 |
112 |
113 | ---
114 | Usage
115 | =====
116 |
117 | For both the `ebs_volume` and `elastic_ip` resources, put the following at the top of the recipe where they are used.
118 |
119 | include_recipe "aws"
120 | aws = data_bag_item("aws", "main")
121 |
122 | aws_ebs_volume
123 | --------------
124 |
125 | The resource only handles manipulating the EBS volume, additional resources need to be created in the recipe to manage the attached volume as a filesystem or logical volume.
126 |
127 | aws_ebs_volume "db_ebs_volume" do
128 | aws_access_key aws['aws_access_key_id']
129 | aws_secret_access_key aws['aws_secret_access_key']
130 | size 50
131 | device "/dev/sdi"
132 | action [ :create, :attach ]
133 | end
134 |
135 | This will create a 50G volume, attach it to the instance as `/dev/sdi`.
136 |
137 | aws_ebs_volume "db_ebs_volume_from_snapshot" do
138 | aws_access_key aws['aws_access_key_id']
139 | aws_secret_access_key aws['aws_secret_access_key']
140 | size 50
141 | device "/dev/sdi"
142 | snapshot_id "snap-ABCDEFGH"
143 | action [ :create, :attach ]
144 | end
145 |
146 | This will create a new 50G volume from the snapshot ID provided and attach it as `/dev/sdi`.
147 |
148 | aws_elastic_ip
149 | --------------
150 |
151 | The `elastic_ip` resource provider does not support allocating new IPs. This must be done before running a recipe that uses the resource. After allocating a new Elastic IP, we recommend storing it in a databag and loading the item in the recipe.
152 |
153 | Databag structure:
154 |
155 | % knife data bag show aws eip_load_balancer_production
156 | {
157 | "id": "eip_load_balancer_production",
158 | "public_ip": "YOUR_ALLOCATED_IP"
159 | }
160 |
161 | Then to set up the Elastic IP on a system:
162 |
163 | ip_info = data_bag_item("aws", "eip_load_balancer_production")
164 |
165 | aws_elastic_ip "eip_load_balancer_production" do
166 | aws_access_key aws['aws_access_key_id']
167 | aws_secret_access_key aws['aws_secret_access_key']
168 | lb ip_info['public_ip']
169 | action :associate
170 | end
171 |
172 | This will use the loaded `aws` and `ip_info` databags to pass the required values into the resource to configure. Note that when associating an Elastic IP to an instance, connectivity to the instance will be lost because the public IP address is changed. You will need to reconnect to the instance with the new IP.
173 |
174 | You can also store this in a role as an attribute or assign to the node directly, if preferred.
175 |
176 | ---
177 | License and Author
178 | ==================
179 |
180 | Author:: Chris Walters ()
181 | Author:: AJ Christensen ()
182 |
183 | Copyright 2009-2010, Opscode, Inc.
184 |
185 | Licensed under the Apache License, Version 2.0 (the "License");
186 | you may not use this file except in compliance with the License.
187 | You may obtain a copy of the License at
188 |
189 | http://www.apache.org/licenses/LICENSE-2.0
190 |
191 | Unless required by applicable law or agreed to in writing, software
192 | distributed under the License is distributed on an "AS IS" BASIS,
193 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194 | See the License for the specific language governing permissions and
195 | limitations under the License.
196 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/mods/mime.conf.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | #
4 | # TypesConfig points to the file containing the list of mappings from
5 | # filename extension to MIME-type.
6 | #
7 | <% case node[:platform] -%>
8 | <% when "arch" -%>
9 | TypesConfig <%= node['apache']['dir'] %>/conf/mime.types
10 | <% else -%>
11 | TypesConfig /etc/mime.types
12 | <% end -%>
13 |
14 | #
15 | # AddType allows you to add to or override the MIME configuration
16 | # file mime.types for specific file types.
17 | #
18 | #AddType application/x-gzip .tgz
19 | #
20 | # AddEncoding allows you to have certain browsers uncompress
21 | # information on the fly. Note: Not all browsers support this.
22 | # Despite the name similarity, the following Add* directives have
23 | # nothing to do with the FancyIndexing customization directives above.
24 | #
25 | #AddEncoding x-compress .Z
26 | #AddEncoding x-gzip .gz .tgz
27 | #AddEncoding x-bzip2 .bz2
28 | #
29 | # If the AddEncoding directives above are commented-out, then you
30 | # probably should define those extensions to indicate media types:
31 | #
32 | AddType application/x-compress .Z
33 | AddType application/x-gzip .gz .tgz
34 | AddType application/x-bzip2 .bz2
35 |
36 | #
37 | # DefaultLanguage and AddLanguage allows you to specify the language of
38 | # a document. You can then use content negotiation to give a browser a
39 | # file in a language the user can understand.
40 | #
41 | # Specify a default language. This means that all data
42 | # going out without a specific language tag (see below) will
43 | # be marked with this one. You probably do NOT want to set
44 | # this unless you are sure it is correct for all cases.
45 | #
46 | # * It is generally better to not mark a page as
47 | # * being a certain language than marking it with the wrong
48 | # * language!
49 | #
50 | # DefaultLanguage nl
51 | #
52 | # Note 1: The suffix does not have to be the same as the language
53 | # keyword --- those with documents in Polish (whose net-standard
54 | # language code is pl) may wish to use "AddLanguage pl .po" to
55 | # avoid the ambiguity with the common suffix for perl scripts.
56 | #
57 | # Note 2: The example entries below illustrate that in some cases
58 | # the two character 'Language' abbreviation is not identical to
59 | # the two character 'Country' code for its country,
60 | # E.g. 'Danmark/dk' versus 'Danish/da'.
61 | #
62 | # Note 3: In the case of 'ltz' we violate the RFC by using a three char
63 | # specifier. There is 'work in progress' to fix this and get
64 | # the reference data for rfc1766 cleaned up.
65 | #
66 | # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
67 | # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
68 | # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
69 | # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
70 | # Norwegian (no) - Polish (pl) - Portugese (pt)
71 | # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
72 | # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
73 | #
74 | AddLanguage ca .ca
75 | AddLanguage cs .cz .cs
76 | AddLanguage da .dk
77 | AddLanguage de .de
78 | AddLanguage el .el
79 | AddLanguage en .en
80 | AddLanguage eo .eo
81 | # See README.Debian for Spanish
82 | AddLanguage es .es
83 | AddLanguage et .et
84 | AddLanguage fr .fr
85 | AddLanguage he .he
86 | AddLanguage hr .hr
87 | AddLanguage it .it
88 | AddLanguage ja .ja
89 | AddLanguage ko .ko
90 | AddLanguage ltz .ltz
91 | AddLanguage nl .nl
92 | AddLanguage nn .nn
93 | AddLanguage no .no
94 | AddLanguage pl .po
95 | AddLanguage pt .pt
96 | AddLanguage pt-BR .pt-br
97 | AddLanguage ru .ru
98 | AddLanguage sv .sv
99 | # See README.Debian for Turkish
100 | AddLanguage tr .tr
101 | AddLanguage zh-CN .zh-cn
102 | AddLanguage zh-TW .zh-tw
103 |
104 | #
105 | # Commonly used filename extensions to character sets. You probably
106 | # want to avoid clashes with the language extensions, unless you
107 | # are good at carefully testing your setup after each change.
108 | # See http://www.iana.org/assignments/character-sets for the
109 | # official list of charset names and their respective RFCs.
110 | #
111 | AddCharset us-ascii .ascii .us-ascii
112 | AddCharset ISO-8859-1 .iso8859-1 .latin1
113 | AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
114 | AddCharset ISO-8859-3 .iso8859-3 .latin3
115 | AddCharset ISO-8859-4 .iso8859-4 .latin4
116 | AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru
117 | AddCharset ISO-8859-6 .iso8859-6 .arb .arabic
118 | AddCharset ISO-8859-7 .iso8859-7 .grk .greek
119 | AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew
120 | AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk
121 | AddCharset ISO-8859-10 .iso8859-10 .latin6
122 | AddCharset ISO-8859-13 .iso8859-13
123 | AddCharset ISO-8859-14 .iso8859-14 .latin8
124 | AddCharset ISO-8859-15 .iso8859-15 .latin9
125 | AddCharset ISO-8859-16 .iso8859-16 .latin10
126 | AddCharset ISO-2022-JP .iso2022-jp .jis
127 | AddCharset ISO-2022-KR .iso2022-kr .kis
128 | AddCharset ISO-2022-CN .iso2022-cn .cis
129 | AddCharset Big5 .Big5 .big5 .b5
130 | AddCharset cn-Big5 .cn-big5
131 | # For russian, more than one charset is used (depends on client, mostly):
132 | AddCharset WINDOWS-1251 .cp-1251 .win-1251
133 | AddCharset CP866 .cp866
134 | AddCharset KOI8 .koi8
135 | AddCharset KOI8-E .koi8-e
136 | AddCharset KOI8-r .koi8-r .koi8-ru
137 | AddCharset KOI8-U .koi8-u
138 | AddCharset KOI8-ru .koi8-uk .ua
139 | AddCharset ISO-10646-UCS-2 .ucs2
140 | AddCharset ISO-10646-UCS-4 .ucs4
141 | AddCharset UTF-7 .utf7
142 | AddCharset UTF-8 .utf8
143 | AddCharset UTF-16 .utf16
144 | AddCharset UTF-16BE .utf16be
145 | AddCharset UTF-16LE .utf16le
146 | AddCharset UTF-32 .utf32
147 | AddCharset UTF-32BE .utf32be
148 | AddCharset UTF-32LE .utf32le
149 | AddCharset euc-cn .euc-cn
150 | AddCharset euc-gb .euc-gb
151 | AddCharset euc-jp .euc-jp
152 | AddCharset euc-kr .euc-kr
153 | #Not sure how euc-tw got in - IANA doesn't list it???
154 | AddCharset EUC-TW .euc-tw
155 | AddCharset gb2312 .gb2312 .gb
156 | AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2
157 | AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4
158 | AddCharset shift_jis .shift_jis .sjis
159 |
160 | #
161 | # AddHandler allows you to map certain file extensions to "handlers":
162 | # actions unrelated to filetype. These can be either built into the server
163 | # or added with the Action directive (see below)
164 | #
165 | # To use CGI scripts outside of ScriptAliased directories:
166 | # (You will also need to add "ExecCGI" to the "Options" directive.)
167 | #
168 | #AddHandler cgi-script .cgi
169 |
170 | #
171 | # For files that include their own HTTP headers:
172 | #
173 | #AddHandler send-as-is asis
174 |
175 | #
176 | # For server-parsed imagemap files:
177 | #
178 | #AddHandler imap-file map
179 |
180 | #
181 | # For type maps (negotiated resources):
182 | # (This is enabled by default to allow the Apache "It Worked" page
183 | # to be distributed in multiple languages.)
184 | #
185 | AddHandler type-map var
186 |
187 | #
188 | # Filters allow you to process content before it is sent to the client.
189 | #
190 | # To parse .shtml files for server-side includes (SSI):
191 | # (You will also need to add "Includes" to the "Options" directive.)
192 | #
193 | AddType text/html .shtml
194 | AddOutputFilter INCLUDES .shtml
195 |
196 |
197 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apt/files/default/apt-cacher.conf:
--------------------------------------------------------------------------------
1 | # This file has been modified by ./apt-proxy-to-apt-cacher
2 | # Some lines may have been appended at the bottom of this file
3 | # This file has been modified by /usr/share/apt-cacher/apt-proxy-to-apt-cacher
4 | # Some lines may have been appended at the bottom of this file
5 | #################################################################
6 | # This is the config file for apt-cacher. On most Debian systems
7 | # you can safely leave the defaults alone.
8 | #################################################################
9 |
10 | # cache_dir is used to set the location of the local cache. This can
11 | # become quite large, so make sure it is somewhere with plenty of space.
12 | cache_dir=/var/cache/apt-cacher
13 |
14 | # The email address of the administrator is displayed in the info page
15 | # and traffic reports.
16 | admin_email=root@localhost
17 |
18 | # For the daemon startup settings please edit the file /etc/default/apt-cacher.
19 |
20 | # Daemon port setting, only useful in stand-alone mode. You need to run the
21 | # daemon as root to use privileged ports (<1024).
22 | daemon_port = 3142
23 |
24 | # optional settings, user and group to run the daemon as. Make sure they have
25 | # sufficient permissions on the cache and log directories. Comment the settings
26 | # to run apt-cacher as the native user.
27 | group=www-data
28 | user=www-data
29 |
30 | # optional setting, binds the listening daemon to one specified IP. Use IP
31 | # ranges for more advanced configuration, see below.
32 | # daemon_addr=localhost
33 |
34 | # If your apt-cacher machine is directly exposed to the Internet and you are
35 | # worried about unauthorised machines fetching packages through it, you can
36 | # specify a list of IPv4 addresses which are allowed to use it and another
37 | # list of IPv4 addresses which aren't.
38 | # Localhost (127.0.0.1) is always allowed. Other addresses must be matched
39 | # by allowed_hosts and not by denied_hosts to be permitted to use the cache.
40 | # Setting allowed_hosts to "*" means "allow all".
41 | # Otherwise the format is a comma-separated list containing addresses,
42 | # optionally with masks (like 10.0.0.0/22), or ranges of addresses (two
43 | # addresses separated by a hyphen, no masks, like '192.168.0.3-192.168.0.56').
44 | allowed_hosts=*
45 | denied_hosts=
46 |
47 | # And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
48 | # Note that IPv4-mapped IPv6 addresses (::ffff:w.x.y.z) are truncated to
49 | # w.x.y.z and are handled as IPv4.
50 | allowed_hosts_6=fec0::/16
51 | denied_hosts_6=
52 |
53 | # This thing can be done by Apache but is much simplier here - limit access to
54 | # Debian mirrors based on server names in the URLs
55 | #allowed_locations=ftp.uni-kl.de,ftp.nerim.net,debian.tu-bs.de
56 |
57 | # Apt-cacher can generate usage reports every 24 hours if you set this
58 | # directive to 1. You can view the reports in a web browser by pointing
59 | # to your cache machine with '/apt-cacher/report' on the end, like this:
60 | # http://yourcache.example.com/apt-cacher/report
61 | # Generating reports is very fast even with many thousands of logfile
62 | # lines, so you can safely turn this on without creating much
63 | # additional system load.
64 | generate_reports=1
65 |
66 | # Apt-cacher can clean up its cache directory every 24 hours if you set
67 | # this directive to 1. Cleaning the cache can take some time to run
68 | # (generally in the order of a few minutes) and removes all package
69 | # files that are not mentioned in any existing 'Packages' lists. This
70 | # has the effect of deleting packages that have been superseded by an
71 | # updated 'Packages' list.
72 | clean_cache=1
73 |
74 | # The directory to use for apt-cacher access and error logs.
75 | # The access log records every request in the format:
76 | # date-time|client ip address|HIT/MISS/EXPIRED|object size|object name
77 | # The error log is slightly more free-form, and is also used for debug
78 | # messages if debug mode is turned on.
79 | # Note that the old 'logfile' and 'errorfile' directives are
80 | # deprecated: if you set them explicitly they will be honoured, but it's
81 | # better to just get rid of them from old config files.
82 | logdir=/var/log/apt-cacher
83 |
84 | # apt-cacher can use different methods to decide whether package lists need to
85 | # be updated,
86 | # A) looking at the age of the cached files
87 | # B) getting HTTP header from server and comparing that with cached data. This
88 | # method is more reliable and avoids desynchronisation of data and index files
89 | # but needs to transfer few bytes from the server every time somebody requests
90 | # the files ("apt-get update")
91 | # Set the following value to the maximum age (in hours) for method A or to 0
92 | # for method B
93 | expire_hours=0
94 |
95 | # Apt-cacher can pass all its requests to an external http proxy like
96 | # Squid, which could be very useful if you are using an ISP that blocks
97 | # port 80 and requires all web traffic to go through its proxy. The
98 | # format is 'hostname:port', eg: 'proxy.example.com:8080'.
99 | http_proxy=proxy.example.com:8080
100 |
101 | # Use of an external proxy can be turned on or off with this flag.
102 | # Value should be either 0 (off) or 1 (on).
103 | use_proxy=0
104 |
105 | # External http proxy sometimes need authentication to get full access. The
106 | # format is 'username:password'.
107 | http_proxy_auth=proxyuser:proxypass
108 |
109 | # Use of external proxy authentication can be turned on or off with this flag.
110 | # Value should be either 0 (off) or 1 (on).
111 | use_proxy_auth=0
112 |
113 | # Rate limiting sets the maximum bandwidth in bytes per second to use
114 | # for fetching packages. Syntax is fully defined in 'man wget'.
115 | # Use 'k' or 'm' to use kilobits or megabits / second: eg, 'limit=25k'.
116 | # Use 0 or a negative value for no rate limiting.
117 | limit=0
118 |
119 | # Debug mode makes apt-cacher spew a lot of extra debug junk to the
120 | # error log (whose location is defined with the 'logdir' directive).
121 | # Leave this off unless you need it, or your error log will get very
122 | # big. Acceptable values are 0 or 1.
123 | debug=0
124 |
125 | # Adapt the line in the usage info web page to match your server configuration
126 | # example_sources_line=deb http://my.cacher.server:3142/ftp.au.debian.org/debian unstable main contrib non-free
127 |
128 | # Print a 410 (Gone) HTTP message with the specified text when accessed via
129 | # CGI. Useful to tell users to adapt their sources.list files when the
130 | # apt-cacher server is beeing relocated (via apt-get's error messages while
131 | # running "update")
132 | #cgi_advise_to_use = Please use http://cacheserver:3142/ as apt-cacher access URL
133 | #cgi_advise_to_use = Server relocated. To change sources.list, run perl -pe "s,/apt-cacher\??,:3142," -i /etc/apt/sources.list
134 |
135 | # Server mapping - this allows to hide real server names behind virtual paths
136 | # that appear in the access URL. This method is known from apt-proxy. This is
137 | # also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons
138 | # path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
139 | # Note that you need to specify all target servers in the allowed_locations
140 | # options if you make use of it. Also note that the paths should not overlap
141 | # each other. FTP access method not supported yet, maybe in the future.
142 |
143 | # extra setting from apt-proxy configuration
144 | path_map = ubuntu us.archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; debian debian.osuosl.org/debian/ ; security security.debian.org/debian-security
145 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "Opscode, Inc."
2 | maintainer_email "cookbooks@opscode.com"
3 | license "Apache 2.0"
4 | description "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions"
5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6 | version "1.0.2"
7 | recipe "apache2", "Main Apache configuration"
8 | recipe "apache2::mod_alias", "Apache module 'alias' with config file"
9 | recipe "apache2::mod_auth_basic", "Apache module 'auth_basic'"
10 | recipe "apache2::mod_auth_digest", "Apache module 'auth_digest'"
11 | recipe "apache2::mod_auth_openid", "Apache module 'authopenid'"
12 | recipe "apache2::mod_authn_file", "Apache module 'authn_file'"
13 | recipe "apache2::mod_authnz_ldap", "Apache module 'authnz_ldap'"
14 | recipe "apache2::mod_authz_default", "Apache module 'authz_default'"
15 | recipe "apache2::mod_authz_groupfile", "Apache module 'authz_groupfile'"
16 | recipe "apache2::mod_authz_host", "Apache module 'authz_host'"
17 | recipe "apache2::mod_authz_user", "Apache module 'authz_user'"
18 | recipe "apache2::mod_autoindex", "Apache module 'autoindex' with config file"
19 | recipe "apache2::mod_cgi", "Apache module 'cgi'"
20 | recipe "apache2::mod_dav", "Apache module 'dav'"
21 | recipe "apache2::mod_dav_svn", "Apache module 'dav_svn'"
22 | recipe "apache2::mod_deflate", "Apache module 'deflate' with config file"
23 | recipe "apache2::mod_dir", "Apache module 'dir' with config file"
24 | recipe "apache2::mod_env", "Apache module 'env'"
25 | recipe "apache2::mod_expires", "Apache module 'expires'"
26 | recipe "apache2::mod_fcgid", "Apache module 'fcgid', package on ubuntu/debian, rhel/centos, compile source on suse; with config file"
27 | recipe "apache2::mod_headers", "Apache module 'headers'"
28 | recipe "apache2::mod_ldap", "Apache module 'ldap'"
29 | recipe "apache2::mod_log_config", "Apache module 'log_config'"
30 | recipe "apache2::mod_mime", "Apache module 'mime' with config file"
31 | recipe "apache2::mod_negotiation", "Apache module 'negotiation' with config file"
32 | recipe "apache2::mod_php5", "Apache module 'php5'"
33 | recipe "apache2::mod_proxy", "Apache module 'proxy' with config file"
34 | recipe "apache2::mod_proxy_ajp", "Apache module 'proxy_ajp'"
35 | recipe "apache2::mod_proxy_balancer", "Apache module 'proxy_balancer'"
36 | recipe "apache2::mod_proxy_connect", "Apache module 'proxy_connect'"
37 | recipe "apache2::mod_proxy_http", "Apache module 'proxy_http'"
38 | recipe "apache2::mod_python", "Apache module 'python'"
39 | recipe "apache2::mod_rewrite", "Apache module 'rewrite'"
40 | recipe "apache2::mod_setenvif", "Apache module 'setenvif' with config file"
41 | recipe "apache2::mod_ssl", "Apache module 'ssl' with config file, adds port 443 to listen_ports"
42 | recipe "apache2::mod_status", "Apache module 'status' with config file"
43 | recipe "apache2::mod_xsendfile", "Apache module 'xsendfile'"
44 |
45 | %w{redhat centos scientific fedora debian ubuntu arch }.each do |os|
46 | supports os
47 | end
48 |
49 | attribute "apache",
50 | :display_name => "Apache Hash",
51 | :description => "Hash of Apache attributes",
52 | :type => "hash"
53 |
54 | attribute "apache/dir",
55 | :display_name => "Apache Directory",
56 | :description => "Location for Apache configuration",
57 | :default => "/etc/apache2"
58 |
59 | attribute "apache/log_dir",
60 | :display_name => "Apache Log Directory",
61 | :description => "Location for Apache logs",
62 | :default => "/etc/apache2"
63 |
64 | attribute "apache/user",
65 | :display_name => "Apache User",
66 | :description => "User Apache runs as",
67 | :default => "www-data"
68 |
69 | attribute "apache/binary",
70 | :display_name => "Apache Binary",
71 | :description => "Apache server daemon program",
72 | :default => "/usr/sbin/apache2"
73 |
74 | attribute "apache/icondir",
75 | :display_name => "Apache Icondir",
76 | :description => "Directory location for icons",
77 | :default => "/usr/share/apache2/icons"
78 |
79 | attribute "apache/listen_ports",
80 | :display_name => "Apache Listen Ports",
81 | :description => "Ports that Apache should listen on",
82 | :type => "array",
83 | :default => [ "80", "443" ]
84 |
85 | attribute "apache/contact",
86 | :display_name => "Apache Contact",
87 | :description => "Email address of webmaster",
88 | :default => "ops@example.com"
89 |
90 | attribute "apache/timeout",
91 | :display_name => "Apache Timeout",
92 | :description => "Connection timeout value",
93 | :default => "300"
94 |
95 | attribute "apache/keepalive",
96 | :display_name => "Apache Keepalive",
97 | :description => "HTTP persistent connections",
98 | :default => "On"
99 |
100 | attribute "apache/keepaliverequests",
101 | :display_name => "Apache Keepalive Requests",
102 | :description => "Number of requests allowed on a persistent connection",
103 | :default => "100"
104 |
105 | attribute "apache/keepalivetimeout",
106 | :display_name => "Apache Keepalive Timeout",
107 | :description => "Time to wait for requests on persistent connection",
108 | :default => "5"
109 |
110 | attribute "apache/servertokens",
111 | :display_name => "Apache Server Tokens",
112 | :description => "Server response header",
113 | :default => "Prod"
114 |
115 | attribute "apache/serversignature",
116 | :display_name => "Apache Server Signature",
117 | :description => "Configure footer on server-generated documents",
118 | :default => "On"
119 |
120 | attribute "apache/traceenable",
121 | :display_name => "Apache Trace Enable",
122 | :description => "Determine behavior of TRACE requests",
123 | :default => "On"
124 |
125 | attribute "apache/allowed_openids",
126 | :display_name => "Apache Allowed OpenIDs",
127 | :description => "Array of OpenIDs allowed to authenticate",
128 | :default => ""
129 |
130 | attribute "apache/prefork",
131 | :display_name => "Apache Prefork",
132 | :description => "Hash of Apache prefork tuning attributes.",
133 | :type => "hash"
134 |
135 | attribute "apache/prefork/startservers",
136 | :display_name => "Apache Prefork MPM StartServers",
137 | :description => "Number of MPM servers to start",
138 | :default => "16"
139 |
140 | attribute "apache/prefork/minspareservers",
141 | :display_name => "Apache Prefork MPM MinSpareServers",
142 | :description => "Minimum number of spare server processes",
143 | :default => "16"
144 |
145 | attribute "apache/prefork/maxspareservers",
146 | :display_name => "Apache Prefork MPM MaxSpareServers",
147 | :description => "Maximum number of spare server processes",
148 | :default => "32"
149 |
150 | attribute "apache/prefork/serverlimit",
151 | :display_name => "Apache Prefork MPM ServerLimit",
152 | :description => "Upper limit on configurable server processes",
153 | :default => "400"
154 |
155 | attribute "apache/prefork/maxclients",
156 | :display_name => "Apache Prefork MPM MaxClients",
157 | :description => "Maximum number of simultaneous connections",
158 | :default => "400"
159 |
160 | attribute "apache/prefork/maxrequestsperchild",
161 | :display_name => "Apache Prefork MPM MaxRequestsPerChild",
162 | :description => "Maximum number of request a child process will handle",
163 | :default => "10000"
164 |
165 | attribute "apache/worker",
166 | :display_name => "Apache Worker",
167 | :description => "Hash of Apache prefork tuning attributes.",
168 | :type => "hash"
169 |
170 | attribute "apache/worker/startservers",
171 | :display_name => "Apache Worker MPM StartServers",
172 | :description => "Initial number of server processes to start",
173 | :default => "4"
174 |
175 | attribute "apache/worker/maxclients",
176 | :display_name => "Apache Worker MPM MaxClients",
177 | :description => "Maximum number of simultaneous connections",
178 | :default => "1024"
179 |
180 | attribute "apache/worker/minsparethreads",
181 | :display_name => "Apache Worker MPM MinSpareThreads",
182 | :description => "Minimum number of spare worker threads",
183 | :default => "64"
184 |
185 | attribute "apache/worker/maxsparethreads",
186 | :display_name => "Apache Worker MPM MaxSpareThreads",
187 | :description => "Maximum number of spare worker threads",
188 | :default => "192"
189 |
190 | attribute "apache/worker/threadsperchild",
191 | :display_name => "Apache Worker MPM ThreadsPerChild",
192 | :description => "Constant number of worker threads in each server process",
193 | :default => "64"
194 |
195 | attribute "apache/worker/maxrequestsperchild",
196 | :display_name => "Apache Worker MPM MaxRequestsPerChild",
197 | :description => "Maximum number of request a child process will handle",
198 | :default => "0"
199 |
--------------------------------------------------------------------------------
/fssle_api/cookbooks/apache2/templates/default/apache2.conf.erb:
--------------------------------------------------------------------------------
1 | #
2 | # Generated by Chef
3 | #
4 | # Based on the Ubuntu apache2.conf
5 |
6 | ServerRoot "<%= node[:apache][:dir] %>"
7 |
8 | #
9 | # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
10 | #
11 | <% if node[:platform] == "debian" || node[:platform] == "ubuntu" -%>
12 | LockFile /var/lock/apache2/accept.lock
13 | <% else %>
14 | LockFile logs/accept.lock
15 | <% end -%>
16 |
17 | #
18 | # PidFile: The file in which the server should record its process
19 | # identification number when it starts.
20 | #
21 | PidFile <%= node[:apache][:pid_file] %>
22 |
23 | #
24 | # Timeout: The number of seconds before receives and sends time out.
25 | #
26 | Timeout <%= node[:apache][:timeout] %>
27 |
28 | #
29 | # KeepAlive: Whether or not to allow persistent connections (more than
30 | # one request per connection). Set to "Off" to deactivate.
31 | #
32 | KeepAlive <%= node[:apache][:keepalive] %>
33 |
34 | #
35 | # MaxKeepAliveRequests: The maximum number of requests to allow
36 | # during a persistent connection. Set to 0 to allow an unlimited amount.
37 | # We recommend you leave this number high, for maximum performance.
38 | #
39 | MaxKeepAliveRequests <%= node[:apache][:keepaliverequests] %>
40 |
41 | #
42 | # KeepAliveTimeout: Number of seconds to wait for the next request from the
43 | # same client on the same connection.
44 | #
45 | KeepAliveTimeout <%= node[:apache][:keepalivetimeout] %>
46 |
47 | ##
48 | ## Server-Pool Size Regulation (MPM specific)
49 | ##
50 |
51 | # prefork MPM
52 | # StartServers: number of server processes to start
53 | # MinSpareServers: minimum number of server processes which are kept spare
54 | # MaxSpareServers: maximum number of server processes which are kept spare
55 | # MaxClients: maximum number of server processes allowed to start
56 | # MaxRequestsPerChild: maximum number of requests a server process serves
57 |
58 | StartServers <%= node[:apache][:prefork][:startservers] %>
59 | MinSpareServers <%= node[:apache][:prefork][:minspareservers] %>
60 | MaxSpareServers <%= node[:apache][:prefork][:maxspareservers] %>
61 | ServerLimit <%= node[:apache][:prefork][:serverlimit] %>
62 | MaxClients <%= node[:apache][:prefork][:maxclients] %>
63 | MaxRequestsPerChild <%= node[:apache][:prefork][:maxrequestsperchild] %>
64 |
65 |
66 | # worker MPM
67 | # StartServers: initial number of server processes to start
68 | # MaxClients: maximum number of simultaneous client connections
69 | # MinSpareThreads: minimum number of worker threads which are kept spare
70 | # MaxSpareThreads: maximum number of worker threads which are kept spare
71 | # ThreadsPerChild: constant number of worker threads in each server process
72 | # MaxRequestsPerChild: maximum number of requests a server process serves
73 |
74 | StartServers <%= node[:apache][:worker][:startservers] %>
75 | MaxClients <%= node[:apache][:worker][:maxclients] %>
76 | MinSpareThreads <%= node[:apache][:worker][:minsparethreads] %>
77 | MaxSpareThreads <%= node[:apache][:worker][:maxsparethreads] %>
78 | ThreadsPerChild <%= node[:apache][:worker][:threadsperchild] %>
79 | MaxRequestsPerChild <%= node[:apache][:worker][:maxrequestsperchild] %>
80 |
81 |
82 | User <%= node[:apache][:user] %>
83 | Group <%= node[:apache][:group] %>
84 |
85 | #
86 | # AccessFileName: The name of the file to look for in each directory
87 | # for additional configuration directives. See also the AllowOverride
88 | # directive.
89 | #
90 |
91 | AccessFileName .htaccess
92 |
93 | #
94 | # The following lines prevent .htaccess and .htpasswd files from being
95 | # viewed by Web clients.
96 | #
97 |
98 | Order allow,deny
99 | Deny from all
100 |
101 |
102 | #
103 | # DefaultType is the default MIME type the server will use for a document
104 | # if it cannot otherwise determine one, such as from filename extensions.
105 | # If your server contains mostly text or HTML documents, "text/plain" is
106 | # a good value. If most of your content is binary, such as applications
107 | # or images, you may want to use "application/octet-stream" instead to
108 | # keep browsers from trying to display binary files as though they are
109 | # text.
110 | #
111 | DefaultType text/plain
112 |
113 |
114 | #
115 | # HostnameLookups: Log the names of clients or just their IP addresses
116 | # e.g., www.apache.org (on) or 204.62.129.132 (off).
117 | # The default is off because it'd be overall better for the net if people
118 | # had to knowingly turn this feature on, since enabling it means that
119 | # each client request will result in AT LEAST one lookup request to the
120 | # nameserver.
121 | #
122 | HostnameLookups Off
123 |
124 | # ErrorLog: The location of the error log file.
125 | # If you do not specify an ErrorLog directive within a
126 | # container, error messages relating to that virtual host will be
127 | # logged here. If you *do* define an error logfile for a
128 | # container, that host's errors will be logged there and not here.
129 | #
130 | ErrorLog <%= node[:apache][:log_dir] %>/error.log
131 |
132 | #
133 | # LogLevel: Control the number of messages logged to the error_log.
134 | # Possible values include: debug, info, notice, warn, error, crit,
135 | # alert, emerg.
136 | #
137 | LogLevel warn
138 |
139 | # Include module configuration:
140 | Include <%= node[:apache][:dir] %>/mods-enabled/*.load
141 | Include <%= node[:apache][:dir] %>/mods-enabled/*.conf
142 |
143 | # Include ports listing
144 | Include <%= node[:apache][:dir] %>/ports.conf
145 |
146 | #
147 | # The following directives define some format nicknames for use with
148 | # a CustomLog directive (see below).
149 | #
150 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
151 | LogFormat "%h %l %u %t \"%r\" %>s %b" common
152 | LogFormat "%{Referer}i -> %U" referer
153 | LogFormat "%{User-agent}i" agent
154 | #
155 |
156 | # Customizable error responses come in three flavors:
157 | # 1) plain text 2) local redirects 3) external redirects
158 | #
159 | # Some examples:
160 | #ErrorDocument 500 "The server made a boo boo."
161 | #ErrorDocument 404 /missing.html
162 | #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
163 | #ErrorDocument 402 http://www.example.com/subscription_info.html
164 | #
165 |
166 | #
167 | # Putting this all together, we can internationalize error responses.
168 | #
169 | # We use Alias to redirect any /error/HTTP_.html.var response to
170 | # our collection of by-error message multi-language collections. We use
171 | # includes to substitute the appropriate text.
172 | #
173 | # You can modify the messages' appearance without changing any of the
174 | # default HTTP_.html.var files by adding the line:
175 | #
176 | # Alias /error/include/ "/your/include/path/"
177 | #
178 | # which allows you to create your own set of files by starting with the
179 | # /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
180 | # even on a per-VirtualHost basis. The default include files will display
181 | # your Apache version number and your ServerAdmin email address regardless
182 | # of the setting of ServerSignature.
183 | #
184 | # The internationalized error documents require mod_alias, mod_include
185 | # and mod_negotiation. To activate them, uncomment the following 30 lines.
186 |
187 | # Alias /error/ "/usr/share/apache2/error/"
188 | #
189 | #
190 | # AllowOverride None
191 | # Options IncludesNoExec
192 | # AddOutputFilter Includes html
193 | # AddHandler type-map var
194 | # Order allow,deny
195 | # Allow from all
196 | # LanguagePriority en cs de es fr it nl sv pt-br ro
197 | # ForceLanguagePriority Prefer Fallback
198 | #
199 | #
200 | # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
201 | # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
202 | # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
203 | # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
204 | # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
205 | # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
206 | # ErrorDocument 410 /error/HTTP_GONE.html.var
207 | # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
208 | # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
209 | # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
210 | # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
211 | # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
212 | # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
213 | # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
214 | # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
215 | # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
216 | # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
217 |
218 |
219 |
220 | # Include generic snippets of statements
221 | Include <%= node[:apache][:dir] %>/conf.d/
222 |
223 | # Include the virtual host configurations:
224 | Include <%= node[:apache][:dir] %>/sites-enabled/
225 |
--------------------------------------------------------------------------------