Version information
This version is compatible with:
- Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 3.7.0 < 5.0.0
- AIX, , , , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-puppet_agent', '1.3.2'
Learn more about managing modules with a PuppetfileDocumentation
#puppet_agent
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with puppet_agent
- Usage - Configuration options and additional functionality
- Reference
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
A module for upgrading Puppet agents. Supports upgrading from Puppet 3 packages and puppet-agent packages, to puppet-agent packages (i.e. Puppet 4).
Module Description
The puppet_agent module installs the Puppet Collection 1 repo (as a default, and on systems that support repositories); migrates configuration required by Puppet to new locations used by puppet-agent; and installs the puppet-agent package, removing the previous Puppet installation. When starting from Puppet 3, it will upgrade to the latest Puppet open-source release, or to the latest puppet-agent package supported by your PE installation.
If a package_version parameter is provided, it will ensure that puppet-agent version is installed. The package_version parameter is required to perform upgrades starting from a puppet-agent (Puppet 4) package.
This module expects Puppet to be installed from packages.
Note: this is the last release that will support Puppet 3 and Ruby <2.1.
Setup
What puppet_agent affects
- Puppet, Facter, Hiera, and MCollective.
- Puppet's SSL directory and puppet.conf.
- MCollective's server.cfg and client.cfg.
- Removes deprecated settings from puppet.conf.
- Updates puppet.conf and server.cfg for behavioral changes in puppet-agent (future parser is now the default, and MCollective has a new varlog location).
Setup Requirements
Your agents must be running Puppet 3 with stringify_facts
set to 'false', or Puppet 4+. Agents should already be pointed at a master running Puppet Server 2.1 or greater, and thus successfully applying catalogs compiled with the Puppet 4 language.
Puppet 3.7 with future parser is required to compile this module, meaning it may be applied to masterless Puppet 3.7+, or earlier Puppet 3 agents connecting to a Puppet 3.7+ master.
Beginning with puppet_agent
Install the puppet_agent module with puppet module install puppetlabs-puppet_agent
.
Usage
Puppet 3 Upgrades
Add the class to agents you want to upgrade:
include ::puppet_agent
This installs the latest released version of Puppet from Puppet Collection 1.
To upgrade with this module, first stand up a Puppet Server 2.1 master---which supports backward compatibility with Puppet 3 agents---and point the agent you want to upgrade at that master. Once you've confirmed the agent runs successfully against the new master, and thus the Puppet 4 language, apply the class to the agent and confirm that it checks back in after a successful upgrade. Further details on upgrading are available here.
As part of preparing the agent for Puppet 4, the module performs several significant steps:
- Copies SSL files (based on their location settings: ssldir, certdir, privatedir, privatekeydir, publickeydir, requestdir) to new Puppet 4 defaults, and restore those settings to default in puppet.conf.
- Resets non-deprecated settings to defaults: disable_warnings, vardir, rundir, libdir, confdir, ssldir, and classfile.
- Resets logfile in MCollective's server.cfg and client.cfg.
- Adds new libdir and plugin.yaml locations to MCollective's server.cfg and client.cfg.
Note: The upgrade does not change several config options. Anything else that's been explicitly configured will not be changed to reflect new default locations in Puppet 4. Some of these options are:
- Puppet's logdir
- MCollective's logfile
Puppet 4 Upgrades
Add the class to agents you want to upgrade, specifying the desired puppet-agent version:
class {'::puppet_agent':
package_version => '1.4.0',
}
This will ensure the version 1.4.0
of the puppet-agent package is installed. For version 1.4.0
and later, it will also remove the deprecated pluginsync
setting from puppet.conf
, unless explicitly managed elsewhere.
Reference
Public classes
Private classes
puppet_agent::install
: Installs packages.puppet_agent::install::remove_packages
: For platforms that can't perform in-place upgrades, removes the old packages.puppet_agent::install::remove_packages_osx
: Removes the old packages on Mac OS X.puppet_agent::osfamily::*
: Platform-specific preparation performed before upgrades.puppet_agent::prepare
: Prepares the agent for upgrade.puppet_agent::prepare::package
: Stages packages locally for install, on platforms that can't install from remote packages.puppet_agent::prepare::*
: Prepare various file and ssl configuration.puppet_agent::service
: Ensures the services are running.puppet_agent::windows::install
: Handles Windows package installation.
Parameters
Class: puppet_agent
arch
The architecture version you wish to install. Defaults to $::architecture
. This parameter is ignored in Windows Server 2003.
collection
The Puppet Collection to track. Defaults to PC1
.
is_pe
Install from Puppet Enterprise repos. Enabled if communicating with a PE master.
manage_repo
Boolean to determine whether to configure zypper/yum/apt/solaris repositories. Defaults to true
.
If set to false, it is assumed an internally hosted repository will be used for the installation,
and the native package providers will be used to query pre-configured repos on the host being upgraded.
package_name
The package to upgrade to, i.e., puppet-agent
. Currently, the default and only accepted value is puppet-agent
.
package_version
The package version to upgrade to. When upgrading from Puppet < 4.0, defaults to the puppet master's latest supported version if compiled with A PE master or undef otherwise (meaning get the latest Open Source release). Explicitly specify a version to upgrade from puppet-agent packages (implying Puppet >= 4.0).
service_names
An array of services to start, normally puppet
and mcollective
. If the array is empty, no services are started.
source
Alternate source from which you wish to download the latest version of Puppet. On the Windows operating system this is the absolute path to the MSI file to install, for example:
source => 'C:/packages/puppet-agent-1.7.0-x64.msi'
install_dir
The directory the puppet agent should be installed to. This is only applicable for Windows operating systems and when upgrading the agent to a new version; it will not cause re-installation of the same version to a new location. This must use backslashes for the path separator, and be an absolute path, for example:
install_dir => 'D:\Program Files\Puppet Labs'
install_options
An array of additional options to pass when installing puppet-agent. Each option in the array can either be a string or a hash. Each option will automatically be quoted when passed to the install command. With Windows packages, note that file paths in an install option must use backslashes. (Since install options are passed directly to the installation command, forward slashes won't be automatically converted like they are in file
resources.) Note also that backslashes in double-quoted strings must be escaped and backslashes in single-quoted strings can be escaped.
install_options => ['PUPPET_AGENT_ACCOUNT_DOMAIN=ExampleCorp','PUPPET_AGENT_ACCOUNT_USER=bob','PUPPET_AGENT_ACCOUNT_PASSWORD=password']
msi_move_locked_files
This is only applicable for Windows operating systems. There may be instances where file locks cause unncessary service restarts. By setting to true, the module will move files prior to installation that are known to cause file locks. By default this is set to false.
msi_move_locked_files => true
Limitations
Mac OS X Open Source packages are currently not supported.
Known issues
- In masterless environments, modules installed manually on individual agents cannot be found after upgrading to Puppet 4.x. You should reinstall these modules on the agents with
puppet module install
.
In addition, there are several known issues with Windows:
- To upgrade the agent by executing
puppet agent -t
interactively in a console, you must close the console and wait for the upgrade to finish before attempting to use thepuppet
command again. - MSI installation failures do not produce any error. If the install fails, puppet_agent continues to be applied to the agent. If this happens, you'll need to examine the MSI log file to determine the failure's cause. You can find the location of the log file in the debug output from either a puppet apply or an agent run; the log file name follows the pattern
puppet-<timestamp>-installer.log
. - On Windows Server 2003, only x86 is supported, and the
arch
parameter is ignored. If you try to force an upgrade to x64, Puppet installs the x86 version with no error message. - On Windows Server 2003 with Puppet Enterprise, the default download location is unreachable. You can work around this issue by specifying an alternate download URL in the
source
parameter.
Specifically in the 1.2.0 Release:
- For Windows, you must trigger an agent run after upgrading so that Puppet can create the necessary directory structures.
Development
Puppet, Inc. modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad hardware, software, and deployment configurations that Puppet is intended to serve. We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see our module contribution guide.
Maintenance
See MAINTAINERS
Change Log
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
[1.3.2] - 2017-02-09
Summary
This is a bug-fix release
Known issues
Carried-over from prior releases:
- For Windows, trigger an agent run after upgrade to get Puppet to create the necessary directory structures.
- Upgrades on EL4-based systems are not supported.
- Mac OS X Open Source package upgrades are not yet implemented.
Bug fixes
- Service management wasn't always applied when intended (MODULES-3994)
- Allow setting MSI installation parameters on Windows (MODULES-4214)
- Ensure all variables are populated to prevent failures when STRICT_VARIABLES='yes'
- Only update server.cfg if not already managed by PE
- Enable the puppet service on Windows if service param includes it (MODULES-4243)
- Add custom fact puppet_agent_appdata, as common_appdata was only defined in PE (MODULES-4241)
- Use getvar to fix facts to work with the strict_variables setting (MODULES-3710)
- Optionally move puppetres.dll on Windows upgrade (MODULES-4207)
- Allow disabling proxy settings for yum repo (MODULES-4236)
[1.3.1] - 2016-11-17
Summary
This is a bug-fix release
Known issues
Carried-over from prior releases:
- For Windows, trigger an agent run after upgrade to get Puppet to create the necessary directory structures.
- Upgrades on EL4-based systems are not supported.
- Mac OS X Open Source package upgrades are not yet implemented.
Bug fixes
- Fix upgrading a global Solaris zone would break upgrading other zones (MODULES-4092)
- Fix line endings of
install_puppet.bat
- Fix upgrading between releases of the same package version (MODULES-4030)
[1.3.0] - 2016-10-19
Summary
The addition of several OS support features and a considerable amount of compatibility and bug fixes.
Known issues
Carried-over from prior releases:
- For Windows, trigger an agent run after upgrade to get Puppet to create the necessary directory structures.
- Upgrades on EL4-based systems are not supported.
- Mac OS X Open Source package upgrades are not yet implemented.
Features
- Add support for Ubuntu 16.04 and Fedora 23
- Allow MSI install path to be defined on Windows (MODULES-3571)
- Allow agent upgrade on non-English versions for Windows (MODULES-3636)
- Allow the use of a hosted repository for packages (MODULES-3872)
- Remove POWER8 restriction for AIX (MODULES-3912)
Bug fixes
- Fix upgrade process on Windows using a PID file (MODULES-3433)
- Fix metadata to indicate support for Puppet 3.7
- Fix upgrade process on Windows by stopping PXP service (MODULES-3449)
- Add extra logging during upgrade process on Windows
- Disable SSL verification on Xenial (PE-16317)
- Fix preserving the environment name when upgrading on Windows (MODULES-3517)
- Puppet run will fail if
stringify_facts
is set totrue
(MODULES-3591 MODULES-3951) - Fix infinite loop scenario on Windows during upgrade (MODULES-3434)
- Fix the waiting process on Windows during an upgrade (MODULES-3657)
- Fix duplicate resource error on AIX with PE (MODULES-3893)
- Fix minor errors in
RakeFile
andspec_helper_acceptance
- Fix setting permissions on Windows package
- Update GPG Keys (RE-7976)
- Fix puppet-agent suffix on Fedora (PE-16317)
- Fix
unless
condition on SUSE and RedHat GPG key imports (MODULES-3894) - Avoid
Unknown variable
errors in Puppet 4 (MODULES-3896) - Fix logic for detecting Solaris 11 package name (PE-17663)
- Fix spec test fixtures to use the Forge
- Add Windows examples to README
- Fix acceptance tests ignoring resource errors (MODULES-3953)
- Add acceptance tests for
manage_repo
parameter (MODULES-3872) - Fix Windows package download URL (MODULES-3970)
[1.2.0] - 2016-05-04
Summary
Supports upgrades from puppet-agent packages! Applies to both PE and FOSS, for example upgrades from PE 2015.3.2 to 2015.3.3 and puppet-agent 1.3.0 to 1.4.0 are supported. Upgrading from older Puppet 3 versions is also no longer explicitly prevented. Adds support for Solaris 11.
Known issues
Carried-over from prior releases:
- For Windows, trigger an agent run after upgrade to get Puppet to create the necessary directory structures.
- Upgrades on EL4-based systems are not supported.
- Upgrades on Fedora systems are not supported.
Newly identified issues:
- Mac OS X Open Source package upgrades are not yet implemented.
- AIX package names are based on PowerPC architecture version. PowerPC 8 is not yet supported.
Features
- Upgrades between puppet-agent packages, such as 2015.2.x to 2015.3.x.
- Adds support for Solaris 11.
- The
pluginsync
setting was deprecated inpuppet-agent 1.4.0
. This module removes it when upgrading to that version or later unless otherwise managed. - Remove the lower-version requirement. All Puppet 3 versions potentially can be upgraded, although testing is only performed starting with Puppet/PE 3.8. Earlier versions likely work back to 3.5, as long as the manifest is compiled using 3.7+ with future parser enabled.
Bug fixes
- Fixes the release identification for Amazon Linux distributions to use EL 6 packages.
- Fix Debian upgrades for PE.
- Support upgrades of 32-bit Windows packages for PE (via pe_repo).
- Fixed an issue that would cause compilation to fail with
Unknown function: 'pe_compiling_server_aio_build'
in some environments.
[1.1.0] - 2016-03-01
Summary
The addition of several OS support features and a considerable amount of compatibility and bug fixes.
Known issues
While this release adds considerable features and bug fixes the following areas are known issues and require more work:
- For Windows, trigger an agent run after upgrade to get Puppet to create the necessary directory structures.
- There is currently ongoing work to allow for upgrading from 2015.2.x to 2015.3.x.
- Solaris 11 support work is in progess, but currently still buggy.
Features
- Adds support for SLES 10, Solaris 10, AIX.
- Add OSX 10.9 upgrades.
- Add no-internet Windows upgrade in PE.
- Added puppet_master_server fact.
- Adds
/opt/puppetlabs
to the managed directories. - Additional test checks for /opt/puppetlabs.
Bug fixes
- Use rspec expect syntax for catching errors.
- Base master_agent_version on pe_compiling_server_aio_build().
- Update in metadata to include support for SLES 10 and 11.
- Ensure pe-puppet/mcollective services stopped after removing the PUPpuppet and PUPmcollective packages.
- Small readme typo fix.
- Pass in Puppet agent PID as command line parameter to avoid recreating install_puppet.bat at every agent run.
- Allow using the internal mirror when resolving gems.
- Add Solaris 10 sparc to supported arch.
- No longer converts Windows file resource to RAL catalog.
- Create/use local_package_dir in params.pp.
- Fix behavior for non-PE.
- Fix specs for Windows changes.
- Remove check for null $service_names.
- Fix linter errors on Windows PR 66.
- Use common_appdata on Windows.
- Removes management of the puppet/mco services on Windows systems.
- Add start/wait to Windows upgrade.
- Pass in configured server to Windows MSI.
- Fixes SLES11 GPG key import issue.
- Fixed regex for SLES compatibility.
- Ensures local MSI package resource defined on Windows.
[1.0.0] - 2015-07-28
Summary
Fixed minor bugs and improved documentation. Now a Puppet Supported module.
Features
- Improved documentation of upgrade process.
Bug fixes
- For Windows PE upgrades, by default install the agent version corresponding to the PE master.
- Reset puppet.conf's classfile setting.
[0.2.0] - 2015-07-21
Summary
Added support for most systems with both Puppet 3.8 and Puppet-Agent packages released by Puppet Labs.
Features
- Support for Debian 6/7, Ubuntu 12.04/14.04, SLES 12, and Windows 2003 through 2012R2.
Bug fixes
- Fix puppet_agent module doesn't touch puppet.conf settings outside an INI section (PUP-4886)
- Made internal classes private, using stdlib's assert_private helper
- Migrate SSL cert directories individually to account for individual settings (PUP-4690)
- Migrated mcollective configuration should prefer the new plugin location (PUP-4658)
- Fixed updating mcollective configuration files with multiple libdir or plugin.yaml definitions (PUP-4746)
[0.1.0] - 2015-06-02
Added
- Initial release of puppetlabs-puppet_agent, supporting Redhat and Centos 5/6/7.
Dependencies
- puppetlabs-stdlib (>= 4.6.0 < 5.0.0)
- puppetlabs-transition (>= 0.1.0 < 0.2.0)
- puppetlabs-inifile (>= 1.2.0 < 2.0.0)
- puppetlabs-apt (>= 2.0.1 < 3.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.