Please review pull request #127: This comments out all but the UpgradePuppet step in the pe_upgrade dir opened by (justinstoller)
Description:
This is totally a sledge hammer kind of fix, but the issue is:
CI will be run with snapshots that are ensured to have known good
setups, skipping based on the --vmrun option would be the best for CI
Locally many will be able to use this as is if they also have known
good snapshots.
I also try to automate as much as I can locally testing PE pre-2.0.
The changes that I'd like to introduce to automate those builds are
not trivial and keeping these files is helpful for my work in that area.
NOTE: This works for me locally with a similar (but not exact) workflow
to CI. It should work in CI.
- Opened: Wed Feb 01 21:53:01 UTC 2012
- Based on: puppetlabs:master (3a118201ba57a5efa48872e1cac4e19b684e1ff7)
- Requested merge: justinstoller:sledgehammer (2adbf86e791f5fc935267d31b4125a26946619a5)
Diff follows:
diff --git a/setup/pe_upgrade/01_PE-InstallPuppet.rb b/setup/pe_upgrade/01_PE-InstallPuppet.rb index 20c19d1..742514e 100755 --- a/setup/pe_upgrade/01_PE-InstallPuppet.rb +++ b/setup/pe_upgrade/01_PE-InstallPuppet.rb @@ -1,59 +1,59 @@ # PE upgrader test -version = options[:upgrade] -test_name "Install Puppet #{version}" -hosts.each do |host| - platform = host['platform'] - - # hack-o-rama: this is likely to be fragile and very PE 1.0, 1.1 specifc: - # Tarballs have changed name rhel- is now el- and affects package naming - # change el- to rhel- to match the old tarball naming/paths. - # It gets worse, of course, as Centos differs from RHEL as well - unless version =~ /^1\.2/ - if platform =~ /el-(.*)/ and host.name.include? 'cent' - platform = "centos-#{$1}" - elsif platform =~ /el-(.*)/ and host.name.include? 'rhel' - platform = "rhel-#{$1}" - end - end - host['dist'] = "puppet-enterprise-#{version}-#{platform}" - long_name = Dir.glob("/opt/enterprise/dists/pe#{version}/*")[0] - basename = File.basename(long_name) - ext = basename.match(/tar.*/).to_s - - unless File.file? "/opt/enterprise/dists/pe#{version}/#{host['dist']}.#{ext}" - Log.error "PE #{host['dist']}.#{ext} not found, help!" - Log.error "" - Log.error "Make sure your configuration file uses the PE version string:" - Log.error " eg: rhel-5-x86_64 centos-5-x86_64" - fail_test "Sorry, PE #{host['dist']}.#{ext} file not found." - end - - step "Pre Test Setup -- SCP install package to hosts" - scp_to host, "/opt/enterprise/dists/pe#{version}/#{host['dist']}.#{ext}", "/tmp" - step "Pre Test Setup -- Untar install package on hosts" - on host,"cd /tmp && tar xf #{host['dist']}.#{ext}" -end - -# Install Master first -- allows for auto cert signing -hosts.each do |host| - next if !( host['roles'].include? 'master' ) - step "SCP Master Answer file to #{host} #{host['dist']}" - scp_to host, "tmp/answers.#{host}", "/tmp/#{host['dist']}" - step "Install Puppet Master" - on host,"cd /tmp/#{host['dist']} && ./puppet-enterprise-installer -a answers.#{host}" -end - -# Install Puppet Agents -step "Install Puppet Agent" -hosts.each do |host| - next if host['roles'].include? 'master' - role_agent=FALSE - role_dashboard=FALSE - role_agent=TRUE if host['roles'].include? 'agent' - role_dashboard=TRUE if host['roles'].include? 'dashboard' - - step "SCP Answer file to dist tar dir" - scp_to host, "tmp/answers.#{host}", "/tmp/#{host['dist']}" - step "Install Puppet Agent" - on host,"cd /tmp/#{host['dist']} && ./puppet-enterprise-installer -a answers.#{host}" -end +#version = options[:upgrade] +#test_name "Install Puppet #{version}" +#hosts.each do |host| +# platform = host['platform'] +# +# # hack-o-rama: this is likely to be fragile and very PE 1.0, 1.1 specifc: +# # Tarballs have changed name rhel- is now el- and affects package naming +# # change el- to rhel- to match the old tarball naming/paths. +# # It gets worse, of course, as Centos differs from RHEL as well +# unless version =~ /^1\.2/ +# if platform =~ /el-(.*)/ and host.name.include? 'cent' +# platform = "centos-#{$1}" +# elsif platform =~ /el-(.*)/ and host.name.include? 'rhel' +# platform = "rhel-#{$1}" +# end +# end +# host['dist'] = "puppet-enterprise-#{version}-#{platform}" +# long_name = Dir.glob("/opt/enterprise/dists/pe#{version}/*")[0] +# basename = File.basename(long_name) +# ext = basename.match(/tar.*/).to_s +# +# unless File.file? "/opt/enterprise/dists/pe#{version}/#{host['dist']}.#{ext}" +# Log.error "PE #{host['dist']}.#{ext} not found, help!" +# Log.error "" +# Log.error "Make sure your configuration file uses the PE version string:" +# Log.error " eg: rhel-5-x86_64 centos-5-x86_64" +# fail_test "Sorry, PE #{host['dist']}.#{ext} file not found." +# end +# +# step "Pre Test Setup -- SCP install package to hosts" +# scp_to host, "/opt/enterprise/dists/pe#{version}/#{host['dist']}.#{ext}", "/tmp" +# step "Pre Test Setup -- Untar install package on hosts" +# on host,"cd /tmp && tar xf #{host['dist']}.#{ext}" +#end +# +## Install Master first -- allows for auto cert signing +#hosts.each do |host| +# next if !( host['roles'].include? 'master' ) +# step "SCP Master Answer file to #{host} #{host['dist']}" +# scp_to host, "tmp/answers.#{host}", "/tmp/#{host['dist']}" +# step "Install Puppet Master" +# on host,"cd /tmp/#{host['dist']} && ./puppet-enterprise-installer -a answers.#{host}" +#end +# +## Install Puppet Agents +#step "Install Puppet Agent" +#hosts.each do |host| +# next if host['roles'].include? 'master' +# role_agent=FALSE +# role_dashboard=FALSE +# role_agent=TRUE if host['roles'].include? 'agent' +# role_dashboard=TRUE if host['roles'].include? 'dashboard' +# +# step "SCP Answer file to dist tar dir" +# scp_to host, "tmp/answers.#{host}", "/tmp/#{host['dist']}" +# step "Install Puppet Agent" +# on host,"cd /tmp/#{host['dist']} && ./puppet-enterprise-installer -a answers.#{host}" +#end diff --git a/setup/pe_upgrade/02_PE-SignCerts.rb b/setup/pe_upgrade/02_PE-SignCerts.rb index 88063a4..dd52ab4 100755 --- a/setup/pe_upgrade/02_PE-SignCerts.rb +++ b/setup/pe_upgrade/02_PE-SignCerts.rb @@ -1,10 +1,12 @@ # Agents certs will remain waiting for signing on master until this step # -step "PE: Puppet Master Sign all Requested Agent Certs" -hosts.each do |host| - # Master auto signs its own cert on startup - next if host['roles'].include? 'master' - on master, puppet("cert --sign #{host}") do - assert_no_match(/Could not call sign/, stdout, "Unable to sign cert for #{host}") - end -end +#skip_test "don't have an upgrade option defined" unless options[:upgrade] +#skip_test "no install selected assuming you've snapshotted at a point passed this" if options[:noinstall] +#step "PE: Puppet Master Sign all Requested Agent Certs" +#hosts.each do |host| +# # Master auto signs its own cert on startup +# next if host['roles'].include? 'master' +# on master, puppet("cert --sign #{host}") do +# assert_no_match(/Could not call sign/, stdout, "Unable to sign cert for #{host}") +# end +#end diff --git a/setup/pe_upgrade/03_PE-SignDashbaordCerts.rb b/setup/pe_upgrade/03_PE-SignDashbaordCerts.rb index 99e4f9d..bc81fb5 100644 --- a/setup/pe_upgrade/03_PE-SignDashbaordCerts.rb +++ b/setup/pe_upgrade/03_PE-SignDashbaordCerts.rb @@ -2,42 +2,42 @@ # This step sets up certificates for the case # when the dashbaord is split up from the puppetmaster # -role_master = FALSE -role_agent = FALSE -role_master_dashboard = FALSE -dashboard_host = nil -# figure out if we have a master, dashboard, and if they are installed on the same machine -hosts.each do |host| - # collect the hosts that correspond to these roles - role_master_dashboard = TRUE if host['roles'].include? 'master' and host['roles'].include? 'dashboard' - if host['roles'].include? 'dashboard' - dashboard_host = host - end - role_master=TRUE if host['roles'].include? 'master' - role_agent=TRUE if host['roles'].include? 'agent' -end - -# we are only testing when we have a dashboard and master on different machines -# and only if the dashboard has an agent installed on the same machine -skip_test "Only need to set up multi-node certs if we are starting with a version of 1.2 or later" and break if options[:upgrade] =~ /^1\.0|1\.1/ -skip_test "Only need to set up multi-node certs if we have a puppet master" and break unless role_master -skip_test "Only need to set up multi-node certs if we have a dashboard" and break unless dashboard_host -skip_test "Only need to set up multi-node certs if dashboard and master are not installed on the same node" and break if role_master_dashboard -skip_tests "This test expects that the dashbaord has an agent installed" and break unless agents.include? dashboard_host - -test_name 'Set up certificates when the dashboard and master are on seperate nodes.' -# set up certs if we have a dashbaord with an agent -# this represents the manual steps that have to be run when the dashboard -# and puppet master are installed on different machines. - -step 'set up dashboard certificates' -# send dashboard csr -on dashboard_host, 'cd /opt/puppet/share/puppet-dashboard; PATH=/opt/puppet/sbin:/opt/puppet/bin:$PATH rake --trace RAILS_ENV=production cert:request' -# sign dashboard cert -on master, puppet("cert --sign dashboard") -# retreive dashboard cert -on dashboard_host, 'cd /opt/puppet/share/puppet-dashboard; PATH=/opt/puppet/sbin:/opt/puppet/bin:$PATH rake --trace RAILS_ENV=production cert:retrieve' -step 'retrieve inventory service certificate.' -on dashboard_host, "/opt/puppet/bin/ruby /opt/puppet/bin/receive_signed_cert.rb #{dashboard_host} #{master}" -step 'start puppet master and inventory service' -on dashboard_host, '/etc/init.d/pe-httpd start' +#role_master = FALSE +#role_agent = FALSE +#role_master_dashboard = FALSE +#dashboard_host = nil +## figure out if we have a master, dashboard, and if they are installed on the same machine +#hosts.each do |host| +# # collect the hosts that correspond to these roles +# role_master_dashboard = TRUE if host['roles'].include? 'master' and host['roles'].include? 'dashboard' +# if host['roles'].include? 'dashboard' +# dashboard_host = host +# end +# role_master=TRUE if host['roles'].include? 'master' +# role_agent=TRUE if host['roles'].include? 'agent' +#end +# +## we are only testing when we have a dashboard and master on different machines +## and only if the dashboard has an agent installed on the same machine +#skip_test "Only need to set up multi-node certs if we are starting with a version of 1.2" and break if options[:upgrade] =~ /^1\.2/ +#skip_test "Only need to set up multi-node certs if we have a puppet master" and break unless role_master +#skip_test "Only need to set up multi-node certs if we have a dashboard" and break unless dashboard_host +#skip_test "Only need to set up multi-node certs if dashboard and master are not installed on the same node" and break if role_master_dashboard +#skip_tests "This test expects that the dashbaord has an agent installed" and break unless agents.include? dashboard_host +# +#test_name 'Set up certificates when the dashboard and master are on seperate nodes.' +## set up certs if we have a dashbaord with an agent +## this represents the manual steps that have to be run when the dashboard +## and puppet master are installed on different machines. +# +#step 'set up dashboard certificates' +## send dashboard csr +#on dashboard_host, 'cd /opt/puppet/share/puppet-dashboard; PATH=/opt/puppet/sbin:/opt/puppet/bin:$PATH rake --trace RAILS_ENV=production cert:request' +## sign dashboard cert +#on master, puppet("cert --sign dashboard") +## retreive dashboard cert +#on dashboard_host, 'cd /opt/puppet/share/puppet-dashboard; PATH=/opt/puppet/sbin:/opt/puppet/bin:$PATH rake --trace RAILS_ENV=production cert:retrieve' +#step 'retrieve inventory service certificate.' +#on dashboard_host, "/opt/puppet/bin/ruby /opt/puppet/bin/receive_signed_cert.rb #{dashboard_host} #{master}" +#step 'start puppet master and inventory service' +#on dashboard_host, '/etc/init.d/pe-httpd start'
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.