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-12299) Add Solaris 11 Support #73

Conversation

demophoon
Copy link

This PR consists of everything needed to get puppet agents on Solaris 11 to upgrade from puppet 3.x to puppet 4.x in a PE environment.

This PR is ready for review, and potentially even a merge.

@demophoon demophoon added the enhancement New feature or request label Dec 18, 2015
@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch 4 times, most recently from 69d0789 to 8263b86 Compare January 11, 2016 19:56
@demophoon
Copy link
Author

I'm waiting on this to be validated on Solaris 11 sparc before removing the 'Do not merge' flag.

@jpartlow
Copy link
Contributor

@demophoon it sounds like it has been validated on solaris i386?

@demophoon
Copy link
Author

Yes, this has been validated on solaris 11 i386. The service bug is still a problem however. I am trying the windows style fix for that however.

@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch from cf9d252 to 8263b86 Compare January 13, 2016 00:35
@jpartlow
Copy link
Contributor

@demophoon The solaris11/windows restart scripts look equally evil. So I guess that's 👍

Is this starting the new services by your testing? Also, looks like a rebase is needed.

@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch from 3453b18 to a0697df Compare January 20, 2016 19:02
@demophoon demophoon changed the title (PE-12299, DO NOT MERGE) Add Solaris 11 Support (PE-12299) Add Solaris 11 Support Jan 26, 2016
@demophoon
Copy link
Author

its_working_star_wars

This is ready for some review. ...maybe.. specs were passing locally.

@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch 7 times, most recently from cfe178f to 52810db Compare January 29, 2016 01:05

$_package_options = {
require => Exec['puppet_agent restore /etc/puppetlabs'],
notify => Exec['puppet_agent post-install restore /etc/puppetlabs'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@demophoon I'm lost here, we seem to be restoring from /tmp/puppet_agent/puppetlabs twice? Is the first a typo where we should be copying /etc to /tmp/puppet_agent/puppetlabs?

If so, how is this currently working?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpartlow We are backing up /etc/puppetlabs/ here: https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/73/files#diff-0b65fa0c1283d2894d43d73f820fe08eR46

Also the restore is needed twice because when we remove the pe-* packages all of /etc/puppetlabs is moved into a lost+found directory determined by the system. The first restore is needed before the puppet-agent package is installed because pkg expects the repo we setup to be in /etc/puppetlabs/installer/solaris.repo/ with the new agent package. The second restore is because when you install the puppet-agent package solaris overwrites any existing user configuration in /etc/puppetlabs/ leaving the puppet.conf in a bad state where it doesn't know its master or any other configuration that a user may have specified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O_o

Ok, I think I've got it.

@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch from 52810db to 14fdfcd Compare February 8, 2016 20:07
@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch from 14fdfcd to 566501d Compare February 8, 2016 21:21
Britt Gresham added 3 commits February 8, 2016 14:27
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.
Before this commit the module was relying on puppet to enforce in the
same order as the array instead of having a relationship between the
packages during uninstallation. This commit adds in relationships
between the packages so that they are always uninstalled in the correct
order.
Before this commit on solaris 11 the configuration file might be backed
up before the files have had their deprecated settings removed. This
meant that when the configuration files were moved back into place which
can cause puppet to fail to start on subsequent runs.

This commit ensures that config files are cleaned up before preparing
the platforms for installing puppet-agent.
Britt Gresham and others added 10 commits February 8, 2016 14:27
Before this commit there was no way to upgrade puppet-agent on Solaris
11 sparc boxes. This commit adds in support for this.
Before this commit when upgrading solaris 11 agents the services would
be in a maintenance state where puppet was unable to start them. This
commit adds in a script which 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.
When testing against pre-released puppet-agent versions the sha that is
appended to the version on solaris 11 does not contain alpha characters.
This commit removes those from the file path so that they can be
downloaded properly from the master.
When removing the packages the /var/opt/lib dir is removed from the
system much like /etc/puppetlabs is removed from the system. The current
agent run is unable to finish successfully since it cannot save a report
to send to puppetdb and fails out after running all of the other
resources.

This commit ensures that those paths exist so that a final report can be
saved and pushed to puppetdb.
@demophoon demophoon force-pushed the feature/master/pe-12299-add-solaris-11 branch from 566501d to b09ff24 Compare February 8, 2016 22:47
@jpartlow
Copy link
Contributor

jpartlow commented Feb 9, 2016

Sadly I'm getting the following error from a frankenbuild:

Notice: /Stage[main]/Puppet_agent::Install/Exec[puppet_agent restore /etc/puppetlabs]/returns: cp: cannot access /tmp/puppet_agent/puppetlabs
      Error: cp -r /tmp/puppet_agent/puppetlabs /etc returned 2 instead of one of [0]
      Error: /Stage[main]/Puppet_agent::Install/Exec[puppet_agent restore /etc/puppetlabs]/returns: change from notrun to 0 failed: cp -r /tmp/puppet_agent/puppetlabs /etc returned 2 instead of one of [0]

I'll add the full details and log to the ticket.

@MikaelSmith
Copy link
Contributor

Needs a rebase.

@MikaelSmith
Copy link
Contributor

Closing in favor of a rebased/squashed version at #93.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants