Skip to content
Browse files

added example roles

  • Loading branch information...
1 parent 8721681 commit 388ff076edb901b0ed2cdba052ed1a8d46346b52 @jeremiahsnapp committed Apr 18, 2012
Showing with 101 additions and 0 deletions.
  1. +11 −0 roles/base.rb
  2. +13 −0 roles/chef_server.rb
  3. +37 −0 roles/common_base.rb
  4. +5 −0 roles/test_chef_solo.rb
  5. +35 −0 roles/web.rb
View
11 roles/base.rb
@@ -0,0 +1,11 @@
+name "base"
+description "Base Role"
+run_list(
+ "recipe[chef-client::delete_validation]", # COOK-986 - normally this should not be run on a chef server
+ "recipe[chef-client::config]", # this will fail if /etc/chef directory doesn't exist
+ "recipe[chef-client::service]",
+ "role[common_base]"
+)
+override_attributes(
+ :chef_client => { :server_url => "https://chef.example.edu" }
+)
View
13 roles/chef_server.rb
@@ -0,0 +1,13 @@
+name "chef_server"
+description "Chef Server Role"
+run_list(
+ "recipe[chef-server::rubygems-install]",
+ "recipe[chef-server::apache-proxy]",
+ "recipe[chef-server]",
+ "recipe[chef-client::config]", # this will fail if /etc/chef directory doesn't exist
+ "recipe[chef-client::service]",
+ "role[common_base]"
+)
+override_attributes(
+ "chef_client" => { "server_url" => "https://chef.example.edu" }
+)
View
37 roles/common_base.rb
@@ -0,0 +1,37 @@
+name "common_base"
+description "Common Base Role"
+run_list(
+ "recipe[apt]",
+ "recipe[git]",
+ "recipe[etckeeper]",
+ "recipe[timezone]",
+ "recipe[byobu]",
+ "recipe[openssh]",
+ "recipe[postfix]",
+ "recipe[postfix::aliases]",
+ "recipe[unattended_upgrades]",
+ "recipe[ntp]",
+ "recipe[logwatch]", # logwatch requires an MTA; make sure postfix recipe is before logwatch
+ "recipe[vim]",
+ "recipe[sudo]",
+ "recipe[base]",
+ "recipe[base::grub]",
+ "recipe[base::sshd]",
+ "recipe[base::iptables]",
+ "recipe[example_users]"
+)
+override_attributes(
+ :tz => "Etc/UTC",
+ :byobu => { :launch_by_default => false },
+ :unattended_upgrades => { :email => "network.admin@example.edu" },
+ :logwatch => { :email => "network.admin@example.edu" },
+ :postfix => { :aliases => { "root" => "network.admin@example.edu" } },
+ :postfix => { :relayhost => "[email.example.edu]" },
+ :authorization => {
+ :sudo => {
+ :groups => [ "sysadmin" ],
+ :passwordless => true,
+ :include_sudoers_d => true
+ }
+ }
+)
View
5 roles/test_chef_solo.rb
@@ -0,0 +1,5 @@
+name "test_chef_solo"
+description "Test Chef Solo Role"
+run_list(
+ "role[web]"
+)
View
35 roles/web.rb
@@ -0,0 +1,35 @@
+name "web"
+description "Web Role"
+run_list(
+ "role[base]",
+ "recipe[web]",
+ "recipe[web::php]",
+ "recipe[web::iptables]"
+)
+override_attributes(
+:apache => {
+ # General settings
+ :contact => "webdeveloper@example.edu",
+ :timeout => "120",
+ :keepalive => "On",
+ :keepaliverequests => "200",
+ :keepalivetimeout => "2",
+
+ # Prefork Attributes
+ :prefork => {
+ :startservers => "8",
+ :minspareservers => "30",
+ :maxspareservers => "40",
+ :serverlimit => "40",
+ :maxclients => "40",
+ :maxrequestsperchild => "1000"
+ }
+},
+:authorization => {
+ :sudo => {
+ :groups => [ "sysadmin", "developers" ],
+ :passwordless => true,
+ :include_sudoers_d => true
+ }
+}
+)

0 comments on commit 388ff07

Please sign in to comment.
Something went wrong with that request. Please try again.