(PE-13179) remove lower version requirement in metadata.json
Prior to this change there was a lower bound on what versions of puppet could be upgraded by the agent module. This has caused users to rely on supplemental tools in some cases to facilitate upgrades. In order to encourage upgrades and make the process easier, we're removing the lower bound. This commit removes logic which enforces the lower bound on the agent version in init.pp, and and the associated specs that ensured the lower limit. This change leaves the lower bound in metadata.json to indicate that we only test upgrades from versions above 3.8.0.
add support for Amazon Linux to puppet_agent::osfamily::redhat
Amazon Linux looks enough like CentOS 6 that we can treat it that way for
purposes of upgrading the puppet agent RPM. The end result of the change is
that on Amazon Linux releases, the module configures the yum "pc1_repo"
baseurl to the "el-6-${::architecture}" subdirectory instead of something
like "el-2015-x86_64" or "el-2014-x86_64".(maint) Fix typo breaking Debian upgrade for PE
This fixes a typo in the apt settings when configuring the repo on the MoM for PE. Without this, apt ignores the syntactically invalid configuration option and attempts to use proxy configuration, which is incorrect and so it fails.
Merge pull request #89 from thrnio/fix_apt_proxy
(maint) Fix typo breaking Debian upgrade for PE
(maint) Fix acceptance using Vagrant configs
Changes to puppetserver defaults and beaker VM naming caused acceptance to start failing when using Vagrant. Add the full VM name to dns_alt_names and increase memory allocated to the master.
(maint) Improve puppet version for install during setup
Previously acceptance tests would install puppet-agent 1.2.1, then install the latest puppetserver prompting an upgrade to a new version of puppet-agent. Now always install the latest puppet-agent and puppetserver. Also provide an environment variable, `PUPPET_CLIENT_VERSION` to allow specifying the starting Puppet version for acceptance tests. This provides a flexible way to run tests of Puppet from any prior version to the latest.
Merge pull request #91 from MikaelSmith/fix-vagrant-acceptance
(maint) Fix acceptance using Vagrant configs, allow flexible starting Puppet version
Merge pull request #85 from oshaughnessy/master
add support for Amazon Linux to puppet_agent::osfamily::redhat
Merge pull request #81 from mwbutcher/task/master/PE-13179_remove_low…
…er_version_requirement_in_metadata.json (PE-13179) remove lower version requirement in code
(maint) Update supported platforms
Updates supported platforms for new package releases and platforms that were added but not noted as supported. Note that specific upgrade scenarios will still depend on Puppet being installed from packages prior to upgrade. `puppet-agent` packages should exist for all supported platforms.
Checking for osfamily == Amazon was a mistake, the osfamily will be RedHat. Repo names on Amazon instances need to be handled specially; they use EL 6 repos. Adds testing for Amazon OS.
(maint) Clarify Puppet 3.x support
Clarifies Puppet 3 version requirements.
Merge pull request #92 from MikaelSmith/support
(maint) Update supported platforms
(PE-11531) Allow upgrades from Puppet 4+
Prior to this commit we only allowed upgrades with this
module if the current puppet version was pre-4.
This commit removes that restriction and hopefully handles
all the edge cases involved in upgrade between new versions
and doesn't break FOSS. This feature should be tested
thoroughly.
This is a squash commit, the original commit messages for the
remainder of the commits are below:
(PE-11531) Use clientversion fact on service mgmt gating
Prior to this commit we were determining whether to manage the
service or not based on the aio_agent_version fact and the is_pe
variable. The is_pe check is redundant because if the module
is being run on a non-PE node, the !is_pe && client_version > 4.0.0
check earlier in the `puppet_agent` class would have already
stopped compilation.
This commit updates the service management to only occur if the
client_version is < 4.0.0. We must do this because PE already
manages the AIO services as part of the Agent nodegroup, so if
this class also managed those resources, we would see conflicts.
(PE-11531) Update min version string in specs
(PE-11531) Remove PE only restriction on 4+ upgrades
There isn't anything special preventing FOSS agents from
upgrading with this module, aside from the various PE
specific sources/prepare statements. We can add restrictions
and notifications about those platforms later.
(PE-11531) Add class relationships to specs
(PE-11531) Remove post-4 upgrade PE restriction
We don't need to restrict checking the services on FOSS
post-4 upgrades because there isn't a PE class managing
that resource.
(PE-11531) Do not test pre-4 file/ssl/mco migration on post-4
Prior to this commit the specs were not updated to match the
behavior of post-4 upgrade. Specifically, they were still attempting
to test that the file/mco/ssl migration resources were being created
but they are not needed on a post-4 upgrade.
This commit removes the unnecessary resource tests and replaces them
with tests to ensure the migration classes are not included on post-4
upgrades.
(PE-11531) Run SuSE specs on puppet 4+
Prior to this commit we were bypassing the specs on SuSE if
running puppet 4+.
This commit updates the specs to run, and adds the required
`package_version` parameter on 4+.
(PE-11531) Test solaris, fix package resource for Sol10
Prior to this commit we were not running specs for Solaris.
This commit enables the specs, and adds the `package_version`
parameter for 4+ puppet. When adding the specs, I noticed that
the solaris 10 package provider doesn't allow `verionable`, we
we'll just have to pass in `present` and hope that the right
package version was setup elsewhere.
(PE-11531) Enable Puppet 4+ testing for RH
(PE-11531) Enable debian specs for Puppet 4+
(PE-11531) Add OSX to Puppet 4+ testing, package_version to spec
OSX, like Solaris 10, does not have a package provider that supports
`versionable`. Therefore, we must `ensure => present` and hope for
the best.
(PE-11531) Solaris 10 check for remove_package
We must verify that Solaris 10 is removing the package
before attempting to install the new one because the
package provider is not able to deal with upgrades.
(PE-11531) Check for OSX packages
Prior to this commit we were not spec testing the package
resources on OSX.
This commit adds a check for osx 10.9/10/11 file resources
for packages.
(PE-11531) Remove 4+ restriction from AIX specs
Also updates specs to account for changes when testing
4+ upgrades.
(PE-11531) Always manage agent, even if already upgraded
Prior to this commit, if a pe agent was already up to date,
we would not attempt to manage any of the resources for it.
This commit removes the early abort if a PE agent is up to date,
and will leave any PE-specific managed resources that need to not
be managed.
(PE-11531) Ensure correct package on AIX by Puppet version
Prior to this commit the specs did not reflect the differing
expected package ensure for version 3 vs 4 puppet.
This commit updates the spec to check for 'present' in 3, and
a specified version in 4.
(PE-11531) Improve spec coverage for osfamilies
Prior to this commit some resources were not being tested
with specs.
This commit covers more those missing resources, bringing coverage
up to > 90%.
(maint) Revert Gemfile puppet to 3.8
Prior to this commit I accidentally committed Puppet 4.0 to the
Gemfile for this project. This commit reverts that change, since
testing on 3.8 by default will help ensure we don't break upgrades
from 3.8.
(PE-11531) Always set _package_version
Prior to this commit `_package_version` would only be
set if it was set and `package_version` differed from
`::clientversion`. This isn't really necessary since
the default for `_package_version` is `undef`, so if
we just check undef elsewhere, we'll know whether a
user wants a specific version or not.
This commit changes the `_package_version` to always
be set to `package_version` (which can be `undef`).
(PE-11531) Clean up puppet_agent::install params
(PE-11531) Allow specifying package version for Windows
Prior to this commit we assumed that the package filename
on windows would not have a version number. This was only
true for PE builds. FOSS builds do have the package version
in the filename.
This commit adds the `_package_version` to the Windows MSI
file name, if it is specified and if we are not a PE install.
(PE-11531) Fix specs for post-4 upgrades
Prior to this commit the branching logic in the specs
that was confining tests to pre-4 did not match the actual
behavior of the module after the changes that we have made
to support post-4 upgrades.
This commit fixes the specs to match the behavior of the
module.
(PE-11531) Update remove_packages for platforms w/ bad pkg mgrs
Prior to this commit we were not properly removing old packages
before attempting to install updated packages on platforms where
jumping thorough such hoops are necessary (Solaris, OSX, SLES 10).
This commit updates the `remove_packages` and `removes_packages_osx`
classes to support versions >= 4.0.0 by removing the `puppet-agent`
package before the `install` class attempts to install the updated
agent package.
(PE-11531) Stop puppet 4+ upgrades if no agent_version is specified
Prior to this commit we had completely removed the restriction on
upgrading Puppet 4+ agents. This would cause the module to attempt
to upgrade agents even if the `$package_version` param had not been
set. This would result in attempting to install non-existent packages
missing the package version and other problems. Unless we want to just
always default to the master agent version, I suggest that we only
upgrade if a `$package_version` is specified.
This commit changes the module to only upgrade Puppet 4+ agents if
a `$package_version` has been specified, as well as making the usage
of `$_package_version` more consistent after `$package_version` has
been assigned to it.
(PE-11531) Require package_version
Prior to this commit we did not actually require that `package_version`
was set, even when we did not have any way of reasonably guessing a
version, such as in FOSS. Additionally, after upgrading to 4+, a user
most likely will not want to immediately want to upgrade to whatever
version of Puppet their Master is running.
This commit makes `package_version` required if you aren't running
PE, or you are running PE and your agent version is already 4+.
Additionally, many of the specs had to be re-worked to support this
new required parameter.
(PE-11531) Use _package_version for aix
Prior to this commit we were for some reason always using the
`master_agent_version` for aix packages. While this is a sensible
default, a user may want to use a different version so we should
make use of the `_package_version`
This commit updates the aix package filename to use the
`_package_version`.
(PE-11531) Ensure package 'present' on non-versionable platforms
Prior to this commit the enforcement of `ensure => present` on platforms
that require `present` because they do not support `versionable` was
inconsistent.
This commit should specifically catch all the platforms that do not
support versionable. More testing will need to be done to ensure that
this is really the case.
(PE-11531) Clarify solaris only supported on PE error
Prior to this commit if someone attempted to upgrade a solaris
agent without PE, it would simply say that Solaris was not supported,
instead of the reality that it is only supported with PE.
This commit updates the error message to reflect that.
(PE-11531) Lint fix: single quotes for non-variable strings
The linter doesn't like double quoted strings without variables,
so this commit changes the lines it was complaining about to use
single quotes.
(PE-11531) Add removal of 'puppet-agent' to `remove_packages`
Prior to this commit the remove packages class was only configured
to remove the Solaris PUPpuppet-agent package. This missed the other
platforms where packages must be removed before they can be re-added,
such as SLES 10.
This commit adds 'puppet-agent' to the packages to be removed for SLES
and AIX.
(PE-11531) Use iterator for OSX specs
Prior to this commit we were repeating the same specs for
each different supported OSX version.
This commit uses an iterator based on the OS version tag to
generate the tests for 10.9, 10.10 and 10.11.
It also adds tests to ensure that old packages are forgotten.
(PE-11531) Use operatingsystemmajrelease
Prior to this commit I was trying to use the `os` hash to
retrieve the major release on RH systems. The
`operatingsystemmajrelease` fact seems to be preferred.
This commit updates the use of the os hash to just use the
fact.
(PE-11531) Update package_version regex
Prior to this commit the package_version regex was failing when
we passed in dev puppet-agent builds.
This commit updates the regex to accept dev build style versions.
Also adds specs to test `package_version` param.
(PE-11531) Remove <3.8 restriction on specs
Prior to this commit a botched rebase added the constraints
on specs not to run on pre 3.8 agents back in.
This commit removes them again.
(PE-11531) Fix variable substitution type in Darwin spec
This commit substitutes `#{package}` with the actual package,
`puppet-agent`.
(PE-11531) Fixup windows specs, correct PE Win guard
Prior to this commit the windows specs would not run on
anything other than 3.7/4.x, so that restriction has
been removed. Additionally, windows needed a spec to test
the upgrading to the master's agent version by default behavior,
so one was added.
In the process of adding that, we discovered
that the windows guard would, in fact, never guard anything
because it was checking a non-existent `agent_version` fact
when the correct fact would have been `aio_agent_version`, which
has now been added.
Also corrects the failed rebase some more by removing the
3.8 guard for init.pp
(PE-11531) Fix specs, use correct scope for package_version
Prior to this commit there were a few more spec changes that needed
to happen around 4+ upgrades relating to testing Transition resources
on SuSE and the facts given to Windows. Also needed a fix in
`remove_packages_osx.pp` for the package_version. I was using
`::package_version` which would just happen to work due to Puppet's
funny scoping rules, but newer puppet is more strict about that so
now I am properly specifying that I want `puppet_agent::package_version`Merge pull request #86 from highb/pe-11531_any_puppet_version_upgrade
(PE-11531) Allow upgrades from Puppet 4+
(PE-14463) Support 32-bit Windows via pe_repo
When installing packages in a PE environment via pe_repo, only 64-bit packages were supported on Windows. Update to also support 32-bit packages.
(maint) Add Windows preparation specs
Adds spec tests for Windows-specific preparation, which primarily involves retrieving the MSI when in a PE environment.
(maint) Remove redundant version declaration
Use the variable to ensure tests for same version use the same source.
(maint) Remove unused param on prepare class
(PE-11531) Fix Debian ensure => version
Prior to this commit I assumed that I could ensure the package version on Debian based platforms using the regular X.Y.Z version. This commit fixes what is ensured on Debian platforms to `X.Y.Z-1codename`, which is what apt expects.
(maint) Re-enable open-source upgrades from 3.x
The prior commit to enable puppet-agent to puppet-agent upgrades set an expectation that a target version would always be required, either from the master or explicitly specified as a parameter. That broke the previous open-source upgrade behavior when upgrading from Puppet 3.x. Restore that behavior by allowing the target version to be unspecified if not on Puppet Enterprise and upgrading from Puppet 3.x. Also add the new dependency puppetlabs-transition for acceptance testing.
Merge pull request #95 from highb/fix/master/pe-11531_debian_ensure_v…
…ersion (PE-11531) Fix Debian ensure => version
Merge pull request #96 from MikaelSmith/fix-foss
(maint) Re-enable open-source upgrades from 3.x
Merge pull request #94 from MikaelSmith/PE-14463
(PE-14463) Support 32-bit Windows via pe_repo
(maint) Bump rspec-puppet-facts to 1.3
(PE-12299) Add Solaris 11 support
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.
(PE-12299) Pass Puppet agent PID as an argument
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.
(maint) Move selecting puppet_version to params
Moves determining puppet_version to params, so private sub-classes can use puppet_agent::puppet_version to get the target version.
(PE-12299) Fix Solaris 11 upgrade from puppet-agent
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`.
(PE-12299) Only rebuild Solaris 11 repo for new packages
Only rebuild the Solaris 11 repo when it doesn't contain the needed package.
(maint) Simplify selecting package file name for Solaris
Combines common logic for determining package file names on Solaris 10 and 11.
Merge pull request #93 from MikaelSmith/feature/master/pe-12299-add-s…
…olaris-11 (PE-12299) Add Solaris 11 support
(maint) Fix a dependency cycle introduced on Windows by Sol11 work
Fixes a dependency cycle introduced by Solaris 11 work. Solaris 11 requires managing config files before preparing packages, because part of preparing the package is saving /etc/puppetlabs where the configs are stored. On Windows, a dependency was introduced because the package is stored to `C:/ProgramData/Puppet Labs/...`, and config files are also stored there. So creating an order of configs before package prepare caused a requirement that C:/ProgramData/Puppet Labs exists both before and after managing config files. Fix that dependency cycle by mananging `C:/ProgramData/Puppet Labs` earlier.
Merge pull request #99 from MikaelSmith/fix-Windows-cycle
(maint) Fix a dependency cycle introduced on Windows by Sol11 work
(maint) Fix issue #98, don't require pe_compiling_server_aio_build
Compilation should not require `pe_compiling_server_aio_build`. Skip calling it if not defined even if `is_pe` is true.
Merge pull request #100 from MikaelSmith/issue-98
(maint) Fix issue #98, don't require `pe_compiling_server_aio_build`
(maint) Fix spec that should've skipped Solaris
Typo in previous spec meant it only skipped SLES (as a PE-only platform). It must also skip Solaris.
Merge pull request #103 from MikaelSmith/fix-spec
(maint) Fix spec that should've skipped Solaris
(PE-14495) Remove pluginsync setting if upgrading to 1.4.x
Merge pull request #101 from MikaelSmith/tphoney-pe-14495
(PE-14495) Remove pluginsync setting if upgrading to 1.4.x
(packaging) Prepare for puppetlabs-puppet_agent 1.2.0
Update changelog, README, and metadata.
Merge pull request #102 from MikaelSmith/release-prep
(packaging) Prepare for puppetlabs-puppet_agent 1.2.0
Merge pull request #104 from bmjen/release_prep
(maint) Update metadata to remove pe requirement.
(PE-11531) Don't remove packages if package_version undef
Prior to this commit we were removing the puppet-agent package if the `package_version` happened to be unset, due to the behavior of `versioncmp`. This is obviously not what we want to have happen. This commit updates all of the calls that compare `package_version` with `aio_agent_version` with `versioncmp` to be gated on `package_version` not being undef, thus preventing the packages from being removed on every run.
Merge pull request #106 from highb/fix/master/pe-11531_fix_version_cm…
…p_usage (PE-11531) Don't remove packages if package_version undef
(maint) Fix handling dev versions on Solaris 11
Version numbers for development packages on Solaris 11 need to be munged, which happened for the file name. However Solaris 11 puppet-agent upgrades use the version number, which was not correctly munged. Fix that, and add testing for development version numbers.
Merge pull request #107 from MikaelSmith/fix-dev-versions
(maint) Fix handling dev versions on Solaris 11
(PE-11531) Centralize check for aio upgrade
Prior to this commit we had the same AIO upgrade expression scattered in 3 different places with slightly different syntax. Also, we did not account for the fact that `aio_agent_version` is a PE only fact. This commit creates a `$aio_upgrade_required` var in the main class that will 1) always be true if not PE and `package_version` is set 2) be true if `aio_agent_version` and `package_version` are set and the `aio_agent_version` is less than (-1) the `package_version`.
Merge pull request #108 from highb/fix/master/pe-11531_centralize_upg…
…rade_check (PE-11531) Centralize check for aio upgrade