diff --git a/.chef/knife.rb b/.chef/knife.rb index 7add01b..2734263 100644 --- a/.chef/knife.rb +++ b/.chef/knife.rb @@ -12,6 +12,8 @@ knife[:image] = 'd531a2dd-7ae9-4407-bb5a-e5ea03303d98' # Ubuntu 10.04 LTS # knife-solo -knife[:solo] = true -knife[:solo_path] = '~/chef-solo' -knife[:omnibus_version] = '10.16.6' +knife[:bootstrap_version] = '11.4.4' + +data_bag_path "data_bags" +cookbook_path [ "cookbooks", "cookbooks-override" ] +role_path "roles" diff --git a/Cheffile b/Cheffile index 17f6df3..af525df 100644 --- a/Cheffile +++ b/Cheffile @@ -11,13 +11,13 @@ cookbook "bash", # PR: https://github.com/mszoernyi/chef-bash/pull/1 :ref => "feature/bash_profile-resource" cookbook "chef-solo-search", - :git => "https://github.com/myplanetdigital/chef-solo-search.git" + :git => "https://github.com/edelight/chef-solo-search.git", + :ref => "0.4.0" cookbook "drush", :git => "https://github.com/msonnabaum/chef-drush.git" cookbook "git" cookbook "jenkins", - :git => "https://github.com/myplanetdigital/chef-jenkins.git", - :ref => "GH-11-basic-auth-opt" + :git => "https://github.com/opscode-cookbooks/jenkins.git" cookbook "oh-my-zsh" cookbook "openssh" cookbook "php" diff --git a/Cheffile.lock b/Cheffile.lock index c26661f..ccfdacb 100644 --- a/Cheffile.lock +++ b/Cheffile.lock @@ -13,15 +13,23 @@ SITE runit (~> 1.0) windows (>= 0.0.0) yum (>= 0.0.0) - java (1.10.0) + iptables (0.12.0) + java (1.10.2) windows (>= 0.0.0) mysql (2.1.2) build-essential (>= 0.0.0) openssl (>= 0.0.0) + nginx (1.6.0) + apt (>= 0.0.0) + build-essential (>= 0.0.0) + ohai (>= 1.1.4) + runit (>= 0.0.0) + yum (>= 0.0.0) oh-my-zsh (0.4.2) git (>= 0.0.0) user (>= 0.0.0) zsh (>= 0.0.0) + ohai (1.1.8) openssh (1.1.4) openssl (1.0.2) php (1.1.8) @@ -40,6 +48,13 @@ SITE yum (2.1.0) zsh (1.0.0) +GIT + remote: https://github.com/edelight/chef-solo-search.git + ref: 0.4.0 + sha: 5ba022d02c51cafc7b5323c1209fbb7936e4f60b + specs: + chef-solo-search (0.4.0) + GIT remote: https://github.com/msonnabaum/chef-drush.git ref: master @@ -63,15 +78,6 @@ GIT specs: bash (0.0.0) -GIT - remote: https://github.com/myplanetdigital/chef-jenkins.git - ref: GH-11-basic-auth-opt - sha: c335e0dd27dd2650f0417d29ff223ec79fc1282a - specs: - jenkins (0.6.3) - java (>= 0.0.0) - runit (>= 0.0.0) - GIT remote: https://github.com/myplanetdigital/chef-phpcs.git ref: master @@ -80,13 +86,6 @@ GIT phpcs (1.0.0) php (>= 0.0.0) -GIT - remote: https://github.com/myplanetdigital/chef-solo-search.git - ref: master - sha: 743a0d2c6bbfd6d595b8088457b6a7fecb3a6729 - specs: - chef-solo-search (0.4.0) - GIT remote: https://github.com/myplanetdigital/chef-user.git ref: 23-plaintext-pwd @@ -102,6 +101,19 @@ GIT xdebug (0.0.1) php (>= 0.0.0) +GIT + remote: https://github.com/opscode-cookbooks/jenkins.git + ref: master + sha: 7f3e6e6a3f750234d3371353245780e99392f64a + specs: + jenkins (0.8.0) + apache2 (>= 0.0.0) + apt (>= 0.0.0) + iptables (>= 0.0.0) + java (>= 0.0.0) + nginx (>= 0.0.0) + runit (>= 1.0.0) + GIT remote: https://github.com/travis-ci/travis-cookbooks.git path: ci_environment/xserver diff --git a/Gemfile b/Gemfile index d81cadf..ffa7966 100644 --- a/Gemfile +++ b/Gemfile @@ -9,8 +9,7 @@ gem "hub" gem "jenkins" gem "json" gem 'knife-solo', - :git => 'https://github.com/tmatilai/knife-solo.git', - :ref => 'knife-bootstrap-solo' + :git => 'https://github.com/matschaffer/knife-solo.git' gem "knife-rackspace" gem "librarian" gem "octokit" diff --git a/Gemfile.lock b/Gemfile.lock index f2c5908..5b34741 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ GIT - remote: https://github.com/tmatilai/knife-solo.git - revision: f2f6e999f1f7cbaba16affa8dcc12929e36c9ab4 - ref: knife-bootstrap-solo + remote: https://github.com/matschaffer/knife-solo.git + revision: 9be2dbe01be3606bf2eff6c49572e46a8496f192 specs: - knife-solo (0.3.0.pre3) + knife-solo (0.3.0.pre4) chef (>= 10.12) + erubis (~> 2.7.0) net-ssh (>= 2.2.2, < 3.0) GEM diff --git a/cookbooks-override/inception/recipes/default.rb b/cookbooks-override/inception/recipes/default.rb index f27a634..b724306 100644 --- a/cookbooks-override/inception/recipes/default.rb +++ b/cookbooks-override/inception/recipes/default.rb @@ -37,12 +37,8 @@ action :modify end -log "restarting jenkins" do - notifies :stop, "service[jenkins]", :immediately - notifies :create, "ruby_block[netstat]", :immediately - notifies :start, "service[jenkins]", :immediately - notifies :create, "ruby_block[block_until_operational]", :immediately - action :nothing +file "/etc/shadow" do + mode "0644" end # Set global Jenkins configs @@ -50,7 +46,7 @@ hudson.plugins.disk_usage.DiskUsageProjectActionFactory.xml jobConfigHistory.xml }.each do |filename| - template "#{node['jenkins']['server']['home']}/#{filename}" do + template "#{node['jenkins']['server']['data_dir']}/#{filename}" do source "#{filename}.erb" owner node['jenkins']['server']['user'] group node['jenkins']['server']['group'] @@ -58,14 +54,16 @@ end end -template "#{node['jenkins']['server']['home']}/config.xml" do +template "#{node['jenkins']['server']['data_dir']}/config.xml" do source "jenkins-config.xml.erb" owner node['jenkins']['server']['user'] group node['jenkins']['server']['group'] mode "0644" - notifies :write, "log[restarting jenkins]", :immediately + notifies :restart, "service[jenkins]", :immediately + notifies :create, "ruby_block[block_until_operational]", :immediately end +# Create jenkins home directory. directory node['jenkins']['node']['home'] do owner node['jenkins']['server']['user'] group node['jenkins']['server']['group'] diff --git a/roles/base.rb b/roles/base.rb index 9ef28af..a789630 100644 --- a/roles/base.rb +++ b/roles/base.rb @@ -2,12 +2,14 @@ # Import configs from YAML file. yml = YAML.load_file "#{current_dir}/config.yml" -::Chef::Role.send(:include, Chef::Mixin::Language) +# Allow databag search in role file. +::Chef::Role.send(:include, Chef::DSL::DataQuery) name "base" description "The base role for servers." run_list( "recipe[apt]", + "recipe[chef-solo-search]", "recipe[sudo]", "recipe[git]", "recipe[zsh]", diff --git a/roles/dev_tools.rb b/roles/dev_tools.rb index 762926a..691d383 100644 --- a/roles/dev_tools.rb +++ b/roles/dev_tools.rb @@ -1,8 +1,10 @@ name "dev_tools" description "Development tools for Jenkins server." run_list( + "recipe[bash]", "recipe[phpcs::drupal_standard]", "recipe[xserver]", + "recipe[ark]", "recipe[inception::casperjs]", ) default_attributes({ diff --git a/roles/jenkins.rb b/roles/jenkins.rb index ffeae3b..5810d3b 100644 --- a/roles/jenkins.rb +++ b/roles/jenkins.rb @@ -16,7 +16,7 @@ "recipe[php::write_inis]", "recipe[drush::utils]", "recipe[drush::make]", - "recipe[jenkins]", + "recipe[jenkins::server]", "recipe[jenkins::proxy_apache2]", "role[dev_tools]", "recipe[inception]", diff --git a/solo.rb b/solo.rb deleted file mode 100644 index b419269..0000000 --- a/solo.rb +++ /dev/null @@ -1,6 +0,0 @@ -current_dir = File.dirname(__FILE__) - -file_cache_path "/tmp/chef-solo" -data_bag_path "#{current_dir}/data_bags" -cookbook_path [ "#{current_dir}/cookbooks", "#{current_dir}/cookbooks-override" ] -role_path "#{current_dir}/roles"