Permalink
Browse files

Having fun with travis ci. #2

  • Loading branch information...
1 parent 9a80a20 commit 8e0500827688c3bd4f8c8d3d71b785c8e965f3a0 @iafonov committed Jul 13, 2012
Showing with 54 additions and 1 deletion.
  1. +53 −0 .chef/bootstrap/travis.erb
  2. +1 −1 Rakefile
View
@@ -0,0 +1,53 @@
+<% "based on https://github.com/fnichol/knife-server/blob/master/lib/chef/knife/bootstrap/chef-server-debian.erb" %>
+bash -c '
+
+set -x
+
+install_1_9_3() {
+ apt-get -y install ruby1.9.1 ruby1.9.1-dev
+}
+
+setup() {
+ platform="$(lsb_release -is | tr [[:upper:]] [[:lower:]])"
+ platform_version="$(lsb_release -rs)"
+}
+
+add_opscode_apt_repo() {
+ echo "deb http://apt.opscode.com/ $(lsb_release -cs)-0.10 main" > \
+ /etc/apt/sources.list.d/opscode.list
+
+ # add the GPG Key and Update Index
+ mkdir -p /etc/apt/trusted.gpg.d
+ apt-get update
+ # permanent upgradeable keyring
+ apt-get install -y --force-yes opscode-keyring
+ apt-get upgrade -y
+}
+
+preseed_chef_pkg() {
+ local preseed=/var/cache/local/preseeding/chef-server.seed
+
+ mkdir -p $(dirname $preseed)
+ cat <<PRESEED > $preseed
+chef chef/chef_server_url string http://127.0.0.1:4000
+chef-server-webui chef-server-webui/admin_password password chefchef
+chef-solr chef-solr/amqp_password password chefchef
+PRESEED
+
+ debconf-set-selections $preseed
+}
+
+install_chef_server() {
+ preseed_chef_pkg
+
+ apt-get install -y --force-yes chef chef-server
+}
+
+setup
+install_1_9_3
+add_opscode_apt_repo
+install_chef_server
+
+printf -- "-----> Bootstraping Chef Server on ${hostname} is complete.\n"
+
+'
View
@@ -28,6 +28,6 @@ namespace :test do
task :self_bootstrap do
system("ssh-add ~/.ssh/identity")
- system("./bin/knife bootstrap localhost --ssh-user #{ENV['USER']} --distro server_ubuntu_1_9_3 --node-name 'chef.localhost' --sudo")
+ system("./bin/knife bootstrap localhost --ssh-user #{ENV['USER']} --distro server_ubuntu_1_9_3 --sudo")
end
end

0 comments on commit 8e05008

Please sign in to comment.