-
Notifications
You must be signed in to change notification settings - Fork 193
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-12299) Add Solaris 11 support #93
(PE-12299) Add Solaris 11 support #93
Conversation
This looks pretty good, planning to do some testing tomorrow. |
@@ -0,0 +1,14 @@ | |||
#!/bin/bash | |||
|
|||
puppet_pid="<%= @puppet_agent_pid %>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An improvement was made to the Windows script to pass in the PID (so the template isn't regenerated on each run). I'll do that here. Is it better to still inline the content (small file) or use a source?
Updated passing PID, but it appears to have some ordering issues in prepare. Working on fixing them. |
d980a42
to
262bb94
Compare
Tested and it looks good, this should be ready to go. @demophoon @highb |
b89bb10
to
03817b1
Compare
Trying again. This needs to be re-tested on Solaris 11. |
Solaris 11 upgrades from 3.8 still appear to work. |
Arg, this needs one more rebase. >_> |
This commit plumbs the puppet agent module to add Solaris 11 support. This commit should be fairly consistent with how pe_repo handles upgrading agents on Solaris 11 by updating the repo in `/etc/puppetlabs/installer/solaris.repo` with the new puppet-agent package and installing puppet-agent from there Lots of things in this commit are less than ideal but the current state of how Solaris 11 packaging handles files through uninstallation/installation. Since Solaris 11 will not uninstall packages if dependant packages are also installed so the packages must be removed in a specific order or else the puppet run will fail. When uninstalling the pe-* packages, Solaris 11 decides to completely remove everything in `/etc/puppetlabs/` which is why this commit has to go through and copy it to a temporary location during the upgrade. However to install puppet-agent, the package needs to be in the repo that lives in `/etc/puppetlabs/installer/solaris.repo` so the that repo needs to be put back into place. After installing the puppet-agent package it overwrites the existing configuration files with the default configuration files. After installing the puppet-agent module the /etc/puppetlabs directory is again copied into place so that the user doesn't lose the ability to talk to the master server or any other configurations that live in /etc/puppetlabs. When upgrading Solaris 11 agents, the services are in a maintenance state where Puppet is unable to start them. Use a script that waits for the currently running agent run to stop and then calls puppet to ensure that puppet and mcollective are running so that users do not have to login to the nodes to perform these steps by hand. This behavior is currently what windows is doing to start puppet and mcollective agents when upgrading with the puppet_agent module.
Similar to the improvement made for the Windows install script, pass the Puppet agent PID as an argument to the solaris service script. This prevents recreating the file every Puppet run.
03817b1
to
ea05394
Compare
Rebased. |
Tested 3.8 -> 2016.1 PE upgrades with this change on a Sol11 box, it passed. Now running 2015.3.3 -> 2016.1. |
Hm, seems that we still aren't installing the transition module:
|
But only on 215.3.3 -> 2016.1 upgrades? |
Seems so. I'm re-examining what we're doing in https://github.com/puppetlabs/pe_acceptance_tests/blob/2016.2.x/setup/agent_upgrade.rb to try to figure out what might be happening. |
Oh, r10k doesn't manage module dependencies. https://github.com/puppetlabs/pe_acceptance_tests-control/blob/production/Puppetfile needs to be updated. Going to put up a PR. |
Hm, looks like something is going wrong with the Transition resource during 2015.3.3 to 2016.1.x upgrade:
Full log of the upgrade run: https://gist.github.com/highb/b0b5351ac43d9eddd08d |
Only on Solaris 11? |
@MikaelSmith I'm checking out Sol10 now. |
Yeah, it appears to only be a problem on Solaris 11 on a 2015.2.3->2015.3.3 upgrade: https://gist.github.com/highb/a4f0179af9149ed5a34ba6dfdda157cb |
I think I've fixed it, running through some tests to be sure. Update: specs are obviously broken, and I want to cleanup the behavior so it doesn't rebuild the repository every run. |
Moves determining puppet_version to params, so private sub-classes can use puppet_agent::puppet_version to get the target version.
bc909e7
to
6fed94e
Compare
Fixes upgrading from a puppet-agent package to a new version on Solaris 11. This simplifies the upgrade process by using the existing publisher with a new version of the package and doing `pkg update`.
20aaa91
to
8a3c997
Compare
Only rebuild the Solaris 11 repo when it doesn't contain the needed package.
8a3c997
to
78ce9af
Compare
@highb passed acceptance runs testing PE 3.8 -> 2015.3.3 and 2015.2.3 -> 2015.3.3. I think this is ready. |
# Strip letters from development builds. | ||
$_version_without_letters = regsubst($package_version, /[a-zA-Z]/, '', 'G') | ||
$_solaris_version = regsubst($_version_without_letters, /(^-|-$)/, '', 'G') | ||
$_package_file_name = "${puppet_agent::package_name}@${_solaris_version},5.11-1.i386.p5p" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't the i386 vs sparc part be set in a variable? Then we wouldn't need to duplicate all the regex for both platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it also make sense for Solaris 10 packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the arch is the same between 10 and 11, right? There could be a $_arch
that is set to either sparc
or i386
depending on the sun4[uv]
regex, and then we just use $_arch
regardless of wether it is on 10 or 11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @demophoon where did needing to strip letters out of development builds come from? If I look at current Solaris 11 package names, I see things like puppet-agent@1.4.1.36.778531,5.11-1.i386.p5p
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MikaelSmith That is how our packaging works with solaris package names. That was taken directly out of Vanagon here: https://github.com/puppetlabs/vanagon/blob/5236eefe97963f3cfc312bbef1e3e1b388d6ffc4/lib/vanagon/platform/solaris_11.rb#L100-L107
Solaris 11 seems to be the only platform that has this version naming oddity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Ok, I'll put it back to Solaris 11 only.
Combines common logic for determining package file names on Solaris 10 and 11.
15e13b9
to
46f2ee5
Compare
Updated. |
Ping @highb |
$_version_without_letters = regsubst($package_version, /[a-zA-Z]/, '', 'G') | ||
$_solaris_version = regsubst($_version_without_letters, /(^-|-$)/, '', 'G') | ||
|
||
$_package_file_name = "${puppet_agent::package_name}@${_solaris_version},5.11-1.${pkg_arch}.p5p" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is what I had in mind! Glad it worked!
This commit plumbs the puppet agent module to add Solaris 11 support.
This commit should be fairly consistent with how pe_repo handles
upgrading agents on Solaris 11 by updating the repo in
/etc/puppetlabs/installer/solaris.repo
with the new puppet-agentpackage and installing puppet-agent from there
Lots of things in this commit are less than ideal but the current state
of how Solaris 11 packaging handles files through
uninstallation/installation.
Since Solaris 11 will not uninstall packages if dependant packages are
also installed so the packages must be removed in a specific order or
else the puppet run will fail.
When uninstalling the pe-* packages, Solaris 11 decides to completely
remove everything in
/etc/puppetlabs/
which is why this commit has togo through and copy it to a temporary location during the upgrade.
However to install puppet-agent, the package needs to be in the repo
that lives in
/etc/puppetlabs/installer/solaris.repo
so the that reponeeds to be put back into place. After installing the puppet-agent
package it overwrites the existing configuration files with the default
configuration files. After installing the puppet-agent module the
/etc/puppetlabs directory is again copied into place so that the user
doesn't lose the ability to talk to the master server or any other
configurations that live in /etc/puppetlabs.
When upgrading Solaris 11 agents, the services are in a maintenance
state where Puppet is unable to start them. Use a script that waits for
the currently running agent run to stop and then calls puppet to ensure
that puppet and mcollective are running so that users do not have to
login to the nodes to perform these steps by hand.
This behavior is currently what windows is doing to start puppet and
mcollective agents when upgrading with the puppet_agent module.