From aa95c1b9696b4b49543e1a37117bc585096a344b Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 13 Feb 2014 17:17:19 +0100 Subject: [PATCH 1/3] Removed already upstream applied patches --- .../master/extra/patches/command.rb.patch | 19 ------------------ releases/roxy/master/extra/patches/patch.sh | 2 -- .../roxy/master/extra/patches/unix.rb.patch | 20 ------------------- .../master/extra/patches/command.rb.patch | 19 ------------------ releases/stoney/master/extra/patches/patch.sh | 2 -- .../stoney/master/extra/patches/unix.rb.patch | 20 ------------------- 6 files changed, 82 deletions(-) delete mode 100644 releases/roxy/master/extra/patches/command.rb.patch delete mode 100644 releases/roxy/master/extra/patches/unix.rb.patch delete mode 100644 releases/stoney/master/extra/patches/command.rb.patch delete mode 100644 releases/stoney/master/extra/patches/unix.rb.patch diff --git a/releases/roxy/master/extra/patches/command.rb.patch b/releases/roxy/master/extra/patches/command.rb.patch deleted file mode 100644 index 113d70d15ed..00000000000 --- a/releases/roxy/master/extra/patches/command.rb.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- /usr/lib/ruby/gems/1.8/gems/ohai-0.6.10/lib/ohai/mixin/command.rb 2011-10-24 10:14:47.000000000 +0100 -+++ command.rb 2012-03-17 02:27:56.000000000 +0000 -@@ -128,6 +128,7 @@ - # - # Thanks Ara! - def popen4(cmd, args={}, &b) -+ GC.disable - - # Waitlast - this is magic. - # -@@ -334,6 +335,8 @@ - end - rescue Errno::ENOENT - raise Ohai::Exceptions::Exec, "command #{cmd} doesn't exist or is not in the PATH" -+ ensure -+ GC.enable - end - - module_function :popen4 diff --git a/releases/roxy/master/extra/patches/patch.sh b/releases/roxy/master/extra/patches/patch.sh index 0bb389d32df..4fe1f2700a9 100755 --- a/releases/roxy/master/extra/patches/patch.sh +++ b/releases/roxy/master/extra/patches/patch.sh @@ -2,8 +2,6 @@ # This applies some common patches that Crowbar needs for Chef to # function the way we expect. patches=( - 'ohai/mixin/command.rb' # OHAI-330 - 'chef/mixin/command/unix.rb' # CHEF-2916 'chef-server-ap*/app/controllers/data_item.rb' # CHEF-2005 'chef/run_list.rb' # Always return run_lists sanely. 'ohai-0.6.6/lib/ohai/plugins/linux/platform.rb' diff --git a/releases/roxy/master/extra/patches/unix.rb.patch b/releases/roxy/master/extra/patches/unix.rb.patch deleted file mode 100644 index 45626c34250..00000000000 --- a/releases/roxy/master/extra/patches/unix.rb.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/mixin/command/unix.rb 2011-12-14 12:31:10.000000000 +0000 -+++ unix.rb 2012-03-17 02:27:56.000000000 +0000 -@@ -28,7 +28,7 @@ - # - # Thanks Ara! - def popen4(cmd, args={}, &b) -- -+ GC.disable - # Waitlast - this is magic. - # - # Do we wait for the child process to die before we yield -@@ -207,6 +207,8 @@ - else - [cid, pw.last, pr.first, pe.first] - end -+ ensure -+ GC.enable - end - - end diff --git a/releases/stoney/master/extra/patches/command.rb.patch b/releases/stoney/master/extra/patches/command.rb.patch deleted file mode 100644 index 113d70d15ed..00000000000 --- a/releases/stoney/master/extra/patches/command.rb.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- /usr/lib/ruby/gems/1.8/gems/ohai-0.6.10/lib/ohai/mixin/command.rb 2011-10-24 10:14:47.000000000 +0100 -+++ command.rb 2012-03-17 02:27:56.000000000 +0000 -@@ -128,6 +128,7 @@ - # - # Thanks Ara! - def popen4(cmd, args={}, &b) -+ GC.disable - - # Waitlast - this is magic. - # -@@ -334,6 +335,8 @@ - end - rescue Errno::ENOENT - raise Ohai::Exceptions::Exec, "command #{cmd} doesn't exist or is not in the PATH" -+ ensure -+ GC.enable - end - - module_function :popen4 diff --git a/releases/stoney/master/extra/patches/patch.sh b/releases/stoney/master/extra/patches/patch.sh index 0bb389d32df..4fe1f2700a9 100755 --- a/releases/stoney/master/extra/patches/patch.sh +++ b/releases/stoney/master/extra/patches/patch.sh @@ -2,8 +2,6 @@ # This applies some common patches that Crowbar needs for Chef to # function the way we expect. patches=( - 'ohai/mixin/command.rb' # OHAI-330 - 'chef/mixin/command/unix.rb' # CHEF-2916 'chef-server-ap*/app/controllers/data_item.rb' # CHEF-2005 'chef/run_list.rb' # Always return run_lists sanely. 'ohai-0.6.6/lib/ohai/plugins/linux/platform.rb' diff --git a/releases/stoney/master/extra/patches/unix.rb.patch b/releases/stoney/master/extra/patches/unix.rb.patch deleted file mode 100644 index 45626c34250..00000000000 --- a/releases/stoney/master/extra/patches/unix.rb.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- /usr/lib/ruby/gems/1.8/gems/chef-0.10.6/lib/chef/mixin/command/unix.rb 2011-12-14 12:31:10.000000000 +0000 -+++ unix.rb 2012-03-17 02:27:56.000000000 +0000 -@@ -28,7 +28,7 @@ - # - # Thanks Ara! - def popen4(cmd, args={}, &b) -- -+ GC.disable - # Waitlast - this is magic. - # - # Do we wait for the child process to die before we yield -@@ -207,6 +207,8 @@ - else - [cid, pw.last, pr.first, pe.first] - end -+ ensure -+ GC.enable - end - - end From 8dbd167f7661d4460a92a1897ff9be82e491c870 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 13 Feb 2014 17:19:41 +0100 Subject: [PATCH 2/3] Added sqlite dependency and pinned gem versions --- redhat-common/chef_install_lib.sh | 2 +- releases/roxy/master/extra/install-chef.sh | 76 +++++++++++++++---- releases/roxy/master/extra/patches/patch.sh | 4 +- releases/stoney/master/extra/install-chef.sh | 76 +++++++++++++++---- releases/stoney/master/extra/patches/patch.sh | 4 +- ubuntu-common/chef_install_lib.sh | 2 +- 6 files changed, 126 insertions(+), 38 deletions(-) diff --git a/redhat-common/chef_install_lib.sh b/redhat-common/chef_install_lib.sh index 622727afbf7..2029a73e455 100755 --- a/redhat-common/chef_install_lib.sh +++ b/redhat-common/chef_install_lib.sh @@ -23,7 +23,7 @@ install_base_packages() { # Install the rpm and gem packages log_to yum yum -q -y install rubygems gcc make ruby-devel \ - libxml2-devel zlib-devel tcpdump nginx efibootmgr + libxml2-devel zlib-devel tcpdump nginx efibootmgr sqlite-devel # stop nginx service nginx stop diff --git a/releases/roxy/master/extra/install-chef.sh b/releases/roxy/master/extra/install-chef.sh index 37dea0e2ad6..6d8ab7540a6 100755 --- a/releases/roxy/master/extra/install-chef.sh +++ b/releases/roxy/master/extra/install-chef.sh @@ -1,20 +1,20 @@ #!/bin/bash # -# Script: instal-chef.sh -# -# Copyright (c) 2011 Dell Inc. +# Copyright 2011-2013, Dell +# Copyright 2013-2014, SUSE LINUX Products GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# if [[ -f /opt/dell/crowbar_framework/.crowbar-installed-ok ]]; then echo "Crowbar is already installed, refusing to let install run." @@ -41,7 +41,10 @@ admin_node_up= # Create log directory and secure it mkdir -p /var/log/crowbar/install -chmod 0750 /var/log/crowbar +chmod 0755 /var/log/crowbar + +touch /var/log/crowbar/production.{out,log} +chown crowbar:crowbar /var/log/crowbar/production.{out,log} # Run a command and log its output. log_to() { @@ -170,13 +173,57 @@ EOF # This is ugly, but there does not seem to be a better way # to tell Chef to just look in a specific location for its gems. echo "$(date '+%F %T %z'): Arranging for gems to be installed" -( cd /tftpboot/gemsite/gems - for gem in builder json net-http-digest_auth i18n activesupport \ - daemons bluepill xml-simple libxml-ruby wsman cstruct ; do - gem install --local --no-ri --no-rdoc $gem-*.gem +( + cd /tftpboot/gemsite/gems + + GEMS=( + # rails stuff + rails-2.3.17 + rake-0.8.7 + rack-1.1.6 + + # crowbar stuff + app_config-1.0.2 + haml-3.1.6 + hike-1.2.1 + i18n-0.4.2 + json-1.6.1 + kwalify-0.7.2 + multi_json-1.0.3 + sass-3.2.12 + simple-navigation-3.7.0 + sprockets-2.10.1 + sprockets-sass-1.0.2 + sprockets-helpers-1.1.0 + sqlite3-1.3.6 + syslogger-1.3.0 + tilt-1.3.3 + mime-types-1.18 + + # install stuff + builder-3.2.2 + bundler-1.0.21 + bluepill-0.0.45 + cstruct-1.0.1 + daemons-1.1.9 + eventmachine-1.0.3 + libxml-ruby-1.1.3 + net-http-digest_auth-1.1.1 + net-ssh-multi-1.1 + state_machine-0.9.4 + rainbows-4.3.1 + wsman-0.0.1 + xml-simple-1.1.3 + ) + + for GEM in ${GEMS[@]} + do + gem install --local --no-ri --no-rdoc ${GEM}.gem done + cd .. - gem generate_index) + gem generate_index +) mkdir -p /var/run/bluepill mkdir -p /var/lib/bluepill @@ -199,8 +246,6 @@ fi bluepill load /etc/bluepill/rubygems-server.pill sleep 5 -gem install eventmachine kwalify app_config - if [[ ! -x /etc/init.d/bluepill ]]; then echo "$(date '+%F %T %z'): Installing Chef" @@ -364,10 +409,9 @@ for role in crowbar deployer-client $NODE_ROLE; do die "Could not add $role to Chef. Crowbar bringup will fail." done -# Create session store database -rm -rf /opt/dell/crowbar_framework/db/migrate -rm -f /opt/dell/crowbar_framework/db/{production.sqlite3,schema.rb} -su -s /bin/sh - crowbar sh -c "cd /opt/dell/crowbar_framework && RAILS_ENV=production rake db:sessions:create && RAILS_ENV=production rake db:migrate" +echo "$(date '+%F %T %z'): Create session store database" +rm -rf /opt/dell/crowbar_framework/db/{migrate,schema.rb,*.sqlite3} +su -s /bin/sh - crowbar sh -c "cd /opt/dell/crowbar_framework && RAILS_ENV=production rake db:sessions:create db:migrate" pre_crowbar_fixups diff --git a/releases/roxy/master/extra/patches/patch.sh b/releases/roxy/master/extra/patches/patch.sh index 4fe1f2700a9..5d74711de3e 100755 --- a/releases/roxy/master/extra/patches/patch.sh +++ b/releases/roxy/master/extra/patches/patch.sh @@ -4,8 +4,8 @@ patches=( 'chef-server-ap*/app/controllers/data_item.rb' # CHEF-2005 'chef/run_list.rb' # Always return run_lists sanely. - 'ohai-0.6.6/lib/ohai/plugins/linux/platform.rb' - 'chef*/provider/package/rubygems.rb' # Make chef honor custom gem options. + # 'ohai-0.6.6/lib/ohai/plugins/linux/platform.rb' + # 'chef*/provider/package/rubygems.rb' # Make chef honor custom gem options. ) for p in "${patches[@]}"; do diff --git a/releases/stoney/master/extra/install-chef.sh b/releases/stoney/master/extra/install-chef.sh index 37dea0e2ad6..6d8ab7540a6 100755 --- a/releases/stoney/master/extra/install-chef.sh +++ b/releases/stoney/master/extra/install-chef.sh @@ -1,20 +1,20 @@ #!/bin/bash # -# Script: instal-chef.sh -# -# Copyright (c) 2011 Dell Inc. +# Copyright 2011-2013, Dell +# Copyright 2013-2014, SUSE LINUX Products GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# if [[ -f /opt/dell/crowbar_framework/.crowbar-installed-ok ]]; then echo "Crowbar is already installed, refusing to let install run." @@ -41,7 +41,10 @@ admin_node_up= # Create log directory and secure it mkdir -p /var/log/crowbar/install -chmod 0750 /var/log/crowbar +chmod 0755 /var/log/crowbar + +touch /var/log/crowbar/production.{out,log} +chown crowbar:crowbar /var/log/crowbar/production.{out,log} # Run a command and log its output. log_to() { @@ -170,13 +173,57 @@ EOF # This is ugly, but there does not seem to be a better way # to tell Chef to just look in a specific location for its gems. echo "$(date '+%F %T %z'): Arranging for gems to be installed" -( cd /tftpboot/gemsite/gems - for gem in builder json net-http-digest_auth i18n activesupport \ - daemons bluepill xml-simple libxml-ruby wsman cstruct ; do - gem install --local --no-ri --no-rdoc $gem-*.gem +( + cd /tftpboot/gemsite/gems + + GEMS=( + # rails stuff + rails-2.3.17 + rake-0.8.7 + rack-1.1.6 + + # crowbar stuff + app_config-1.0.2 + haml-3.1.6 + hike-1.2.1 + i18n-0.4.2 + json-1.6.1 + kwalify-0.7.2 + multi_json-1.0.3 + sass-3.2.12 + simple-navigation-3.7.0 + sprockets-2.10.1 + sprockets-sass-1.0.2 + sprockets-helpers-1.1.0 + sqlite3-1.3.6 + syslogger-1.3.0 + tilt-1.3.3 + mime-types-1.18 + + # install stuff + builder-3.2.2 + bundler-1.0.21 + bluepill-0.0.45 + cstruct-1.0.1 + daemons-1.1.9 + eventmachine-1.0.3 + libxml-ruby-1.1.3 + net-http-digest_auth-1.1.1 + net-ssh-multi-1.1 + state_machine-0.9.4 + rainbows-4.3.1 + wsman-0.0.1 + xml-simple-1.1.3 + ) + + for GEM in ${GEMS[@]} + do + gem install --local --no-ri --no-rdoc ${GEM}.gem done + cd .. - gem generate_index) + gem generate_index +) mkdir -p /var/run/bluepill mkdir -p /var/lib/bluepill @@ -199,8 +246,6 @@ fi bluepill load /etc/bluepill/rubygems-server.pill sleep 5 -gem install eventmachine kwalify app_config - if [[ ! -x /etc/init.d/bluepill ]]; then echo "$(date '+%F %T %z'): Installing Chef" @@ -364,10 +409,9 @@ for role in crowbar deployer-client $NODE_ROLE; do die "Could not add $role to Chef. Crowbar bringup will fail." done -# Create session store database -rm -rf /opt/dell/crowbar_framework/db/migrate -rm -f /opt/dell/crowbar_framework/db/{production.sqlite3,schema.rb} -su -s /bin/sh - crowbar sh -c "cd /opt/dell/crowbar_framework && RAILS_ENV=production rake db:sessions:create && RAILS_ENV=production rake db:migrate" +echo "$(date '+%F %T %z'): Create session store database" +rm -rf /opt/dell/crowbar_framework/db/{migrate,schema.rb,*.sqlite3} +su -s /bin/sh - crowbar sh -c "cd /opt/dell/crowbar_framework && RAILS_ENV=production rake db:sessions:create db:migrate" pre_crowbar_fixups diff --git a/releases/stoney/master/extra/patches/patch.sh b/releases/stoney/master/extra/patches/patch.sh index 4fe1f2700a9..5d74711de3e 100755 --- a/releases/stoney/master/extra/patches/patch.sh +++ b/releases/stoney/master/extra/patches/patch.sh @@ -4,8 +4,8 @@ patches=( 'chef-server-ap*/app/controllers/data_item.rb' # CHEF-2005 'chef/run_list.rb' # Always return run_lists sanely. - 'ohai-0.6.6/lib/ohai/plugins/linux/platform.rb' - 'chef*/provider/package/rubygems.rb' # Make chef honor custom gem options. + # 'ohai-0.6.6/lib/ohai/plugins/linux/platform.rb' + # 'chef*/provider/package/rubygems.rb' # Make chef honor custom gem options. ) for p in "${patches[@]}"; do diff --git a/ubuntu-common/chef_install_lib.sh b/ubuntu-common/chef_install_lib.sh index c799523f514..bc5f18a1a61 100755 --- a/ubuntu-common/chef_install_lib.sh +++ b/ubuntu-common/chef_install_lib.sh @@ -16,7 +16,7 @@ install_base_packages() { log_to apt /usr/bin/debconf-set-selections ./debsel.conf log_to apt apt-get -y install rubygems gcc ruby tcpdump \ libcurl4-gnutls-dev build-essential ruby-dev libxml2-dev zlib1g-dev nginx-light \ - ipmitool efibootmgr + ipmitool efibootmgr libsqlite3-dev # stop nginx service nginx stop From fb85117b33d52838940891e65ffd77235de34f66 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Fri, 21 Feb 2014 12:29:05 +0100 Subject: [PATCH 3/3] Added chown for crowbar user within chef install --- releases/roxy/master/extra/install-chef.sh | 2 ++ releases/roxy/openstack-os-build/barclamp-cisco-ucs | 1 + 2 files changed, 3 insertions(+) create mode 100644 releases/roxy/openstack-os-build/barclamp-cisco-ucs diff --git a/releases/roxy/master/extra/install-chef.sh b/releases/roxy/master/extra/install-chef.sh index 6d8ab7540a6..898f40f0384 100755 --- a/releases/roxy/master/extra/install-chef.sh +++ b/releases/roxy/master/extra/install-chef.sh @@ -409,6 +409,8 @@ for role in crowbar deployer-client $NODE_ROLE; do die "Could not add $role to Chef. Crowbar bringup will fail." done +chown -R crowbar:crowbar /opt/dell/crowbar_framework /var/log/crowbar + echo "$(date '+%F %T %z'): Create session store database" rm -rf /opt/dell/crowbar_framework/db/{migrate,schema.rb,*.sqlite3} su -s /bin/sh - crowbar sh -c "cd /opt/dell/crowbar_framework && RAILS_ENV=production rake db:sessions:create db:migrate" diff --git a/releases/roxy/openstack-os-build/barclamp-cisco-ucs b/releases/roxy/openstack-os-build/barclamp-cisco-ucs new file mode 100644 index 00000000000..eecb8e829ee --- /dev/null +++ b/releases/roxy/openstack-os-build/barclamp-cisco-ucs @@ -0,0 +1 @@ +release/roxy/master