Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-18728 Skip frictionless install if agent has powershell2 bug #45

Conversation

cthorn42
Copy link
Collaborator

We introduced frictionless installs for Windows agents in PE 2016.4.0.
For upgrade scenarios where we are testing frictionless upgrades, to
install we need to use the old MSI method if we are installing less then
PE 2016.4.0.
However, we have discovered that frictionless installs of windows2008r2
will fail on PE 2016.4.0 and PE 2016.4.2.
This PR adds in logic to install with the non-frictionless method if the
agent is windows2008r2 and version is less then PE 2016.4.3.

@puppetlabs-jenkins
Copy link
Contributor

Can one of the admins verify this patch?

@cthorn42
Copy link
Collaborator Author

This was tested locally by first doing an install/upgrade of a windows2012, ie something with powershell greater then 2. Upgraded from PE 2016.4.2 to latest PE 2016.4.x, and on both install and upgrade frictionless method was used. So my change doesn't affect this, as expected.

My setup to test this was from pe_acceptance_tests

export pe_version=2016.4.2
export pe_family=2016.4.2
export pe_upgrade_version=2016.4.3-rc0-7-g65e24d7
pe_upgrade_version=2016.4.3-rc0-7-g65e24d7
bundle exec beaker-hostgenerator centos6-64mcd-windows2008r2-64f-6432f > hosts.cfg
bundle exec beaker -h hosts.cfg --tests acceptance/tests --helper lib/beaker_helper.rb --post-suite acceptance/post --pre-suite setup/install.rb,setup/frictionless_agent_upgrade.rb --log-level verbose

And when it got to a windows agent, it used the old MSI method to install the agent:

mn23tmzkte07wk4.delivery.puppetlabs.net (windows2008r2-64-1) executed in 0.08 seconds
  localhost $ scp /var/folders/51/zzwtq8mx28d2d4xpg26xk3n00000gn/T/install-puppet-msi-2016-12-22_08.47.41.bat20161222-11240-1u4a1dz windows2008r2-64-1:C:\Windows\TEMP\install-puppet-msi-2016-12-22_08.47.41.bat {:ignore => }

And when it was time to upgrade, it used frictionless:

    mn23tmzkte07wk4.delivery.puppetlabs.net (windows2008r2-64-1) 09:01:42$ powershell -c "cd C:/cygwin64/tmp/2016-12-22_08.41.01.G5Y1J8;[Net.ServicePointManager]::ServerCertificateValidationCallback = {\$true};\$webClient = New-Object System.Net.WebClient;\$webClient.DownloadFile('https://tnuailnq3qc8imo.delivery.puppetlabs.net:8140/packages/2016.4.3-rc0-7-g65e24d7/install.ps1', 'C:/cygwin64/tmp/2016-12-22_08.41.01.G5Y1J8/install.ps1');C:/cygwin64/tmp/2016-12-22_08.41.01.G5Y1J8/install.ps1 -verbose"
      VERBOSE: Downloading the Puppet Agent for Puppet Enterprise on
      MN23TMZKTE07WK4...
      VERBOSE: Installing the Puppet Agent on MN23TMZKTE07WK4...
      VERBOSE: Saving the install log to
      C:\Users\Administrator\2016-12-22T17-01-42-puppet-install.log

@kevpl
Copy link
Contributor

kevpl commented Dec 22, 2016

@cthorn42 would you add a spec test to make sure we don't break this with future work?

Also, I thought we were stopping support for win2008 at the end of the year. Not the case?

@cthorn42
Copy link
Collaborator Author

@kevpl re: win2008 support might be going away, but I think win2008r2 will still be supported.
I know a big difference between those two is win2008 uses powershell v1, and win2008r2 uses powershell v2.
And PE-18351 is in PE 2016.4.3, and that is a fix for powershell v2.
About spec test that is very reasonable and I'll get on it.

@puppetlabs-jenkins
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker-pe_btc-intn/141/

@cthorn42 cthorn42 force-pushed the maint/master/PE-18728_add_msi_install_method_in_certain_cases branch from 272bfcc to 5f3c31a Compare December 29, 2016 04:20
@cthorn42
Copy link
Collaborator Author

@kevpl I've updated this PR and added spec tests to cover the new method install_via_msi?.
It has been a long time since I wrote any spec tests, so let me know if you want me to adjust anything.

@puppetlabs-jenkins
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker-pe_btc-intn/142/

… 2 bug

We introduced frictionless installs for Windows agents in PE 2016.4.0.
For upgrade scenarios where we are testing frictionless upgrades, to
install we need to use the old MSI method if we are installing less then
PE 2016.4.0.
However, we have discovered that frictionless installs of windows2008r2
will fail on PE 2016.4.0 and PE 2016.4.2.
This PR adds in logic to install with the non-frictionless method if the
agent is windows2008r2 and version is less then PE 2016.4.3.
@cthorn42 cthorn42 force-pushed the maint/master/PE-18728_add_msi_install_method_in_certain_cases branch from 5f3c31a to f23264e Compare December 29, 2016 17:23
@puppetlabs-jenkins
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker-pe_btc-intn/143/

@kevpl kevpl merged commit 48b3b78 into puppetlabs:master Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants