12 changes: 7 additions & 5 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
transition: "https://github.com/puppetlabs/puppetlabs-transition.git"
inifile: "https://github.com/puppetlabs/puppetlabs-inifile.git"
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
forge_modules:
stdlib:
repo: "puppetlabs/stdlib"
ref: "4.12.0"
transition: "puppetlabs/transition"
inifile: "puppetlabs/inifile"
apt: "puppetlabs/apt"
symlinks:
puppet_agent: "#{source_dir}"
54 changes: 48 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,49 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.2.0]
## [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](https://tickets.puppetlabs.com/browse/MODULES-3571))
- Allow agent upgrade on non-English versions for Windows ([MODULES-3636](https://tickets.puppetlabs.com/browse/MODULES-3636))
- Allow the use of a hosted repository for packages ([MODULES-3872](https://tickets.puppetlabs.com/browse/MODULES-3872))
- Remove POWER8 restriction for AIX ([MODULES-3912](https://tickets.puppetlabs.com/browse/MODULES-3912))

### Bug fixes
- Fix upgrade process on Windows using a PID file ([MODULES-3433](https://tickets.puppetlabs.com/browse/MODULES-3433))
- Fix metadata to indicate support for Puppet 3.7
- Fix upgrade process on Windows by stopping PXP service ([MODULES-3449](https://tickets.puppetlabs.com/browse/MODULES-3449))
- Add extra logging during upgrade process on Windows
- Disable SSL verification on Xenial ([PE-16317](https://tickets.puppetlabs.com/browse/PE-16317))
- Fix preserving the environment name when upgrading on Windows ([MODULES-3517](https://tickets.puppetlabs.com/browse/MODULES-3517))
- Puppet run will fail if `stringify_facts` is set to `true` ([MODULES-3591](https://tickets.puppetlabs.com/browse/MODULES-3591) [MODULES-3951](https://tickets.puppetlabs.com/browse/MODULES-3951))
- Fix infinite loop scenario on Windows during upgrade ([MODULES-3434](https://tickets.puppetlabs.com/browse/MODULES-3434))
- Fix the waiting process on Windows during an upgrade ([MODULES-3657](https://tickets.puppetlabs.com/browse/MODULES-3657))
- Fix duplicate resource error on AIX with PE ([MODULES-3893](https://tickets.puppetlabs.com/browse/MODULES-3893))
- Fix minor errors in `RakeFile` and `spec_helper_acceptance`
- Fix setting permissions on Windows package
- Update GPG Keys ([RE-7976](https://tickets.puppetlabs.com/browse/RE-7976))
- Fix puppet-agent suffix on Fedora ([PE-16317](https://tickets.puppetlabs.com/browse/PE-16317))
- Fix `unless` condition on SUSE and RedHat GPG key imports ([MODULES-3894](https://tickets.puppetlabs.com/browse/MODULES-3894))
- Avoid `Unknown variable` errors in Puppet 4 ([MODULES-3896](https://tickets.puppetlabs.com/browse/MODULES-3896))
- Fix logic for detecting Solaris 11 package name ([PE-17663](https://tickets.puppetlabs.com/browse/PE-17663))
- Fix spec test fixtures to use the Forge
- Add Windows examples to README
- Fix acceptance tests ignoring resource errors ([MODULES-3953](https://tickets.puppetlabs.com/browse/MODULES-3953))
- Add acceptance tests for `manage_repo` parameter ([MODULES-3872](https://tickets.puppetlabs.com/browse/MODULES-3872))
- Fix Windows package download URL ([MODULES-3970](https://tickets.puppetlabs.com/browse/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
Expand All @@ -28,14 +70,14 @@ that version or later unless otherwise managed.
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.

### Bugfixes
### 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]
## [1.1.0] - 2016-03-01

### Summary
The addition of several OS support features and a considerable amount of compatibility and bug fixes.
Expand All @@ -54,7 +96,7 @@ While this release adds considerable features and bug fixes the following areas
- Adds `/opt/puppetlabs` to the managed directories.
- Additional test checks for /opt/puppetlabs.

### Bugfixes
### 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.
Expand Down Expand Up @@ -86,7 +128,7 @@ Fixed minor bugs and improved documentation. Now a Puppet Supported module.
### Features
- Improved documentation of upgrade process.

### Bugfixes
### Bug fixes
- For Windows PE upgrades, by default install the agent version corresponding to the PE master.
- Reset puppet.conf's classfile setting.

Expand All @@ -99,7 +141,7 @@ Added support for most systems with both Puppet 3.8 and Puppet-Agent packages re
### Features
- Support for Debian 6/7, Ubuntu 12.04/14.04, SLES 12, and Windows 2003 through 2012R2.

### Bugfixes
### 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)
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ group :test do
gem 'rspec', '< 3.2.0' # https://github.com/rspec/rspec-core/issues/1864
gem 'rspec-puppet', '~> 2.2'
gem 'puppetlabs_spec_helper', '~> 0.10'
gem 'json_pure', '~> 1.8.3' # avoid version incompatible with Puppet 3.8
gem 'json', '~> 1.8.3' # avoid trying to pull a newer version with Ruby 1.8.7
gem 'metadata-json-lint', '~> 0.0'
gem 'rspec-puppet-facts', '~> 1.3'
end

group :system_tests do
gem 'beaker', '~> 2.16'
gem 'beaker-rspec', '~> 5.1'
gem 'beaker-hostgenerator'
end
27 changes: 27 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": 1,
"file_format": "This MAINTAINERS file format is described at http://pup.pt/maintainers",
"issues": "https://github.com/puppetlabs/puppetlabs-puppet_agent/issues",
"people": [
{
"github": "MikaelSmith",
"email": "michael.smith@puppet.com",
"name": "Michael Smith"
},
{
"github": "highb",
"email": "brandon.high@puppet.com",
"name": "Brandon High"
},
{
"github": "MosesMendoza",
"email": "moses@puppet.com",
"name": "Moses Mendoza"
},
{
"github": "glennsarti",
"email": "glenn.sarti@puppet.com",
"name": "Glenn Sarti"
}
]
}
64 changes: 40 additions & 24 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ As part of preparing the agent for Puppet 4, the module performs several signifi
* 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:
Expand All @@ -81,12 +85,12 @@ class {'::puppet_agent':

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
## Reference

###Public classes
### Public classes
* [`puppet_agent`](#class-puppetagent)

###Private 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.
Expand All @@ -97,45 +101,62 @@ This will ensure the version `1.4.0` of the puppet-agent package is installed. F
* `puppet_agent::service`: Ensures the services are running.
* `puppet_agent::windows::install`: Handles Windows package installation.

###Parameters
### Parameters

####Class: puppet_agent
#### Class: puppet_agent

#####`arch`
##### `arch`

The architecture version you wish to install. Defaults to `$::architecture`. This parameter is [ignored](#known-issues) in Windows Server 2003.

#####`collection`
##### `collection`

The Puppet Collection to track. Defaults to `PC1`.

#####`is_pe`
##### `is_pe`

Install from Puppet Enterprise repos. Enabled if communicating with a PE master.

Install from Puppet Enterprise rpos. Enabled if communicating with a PE master.
##### `manage_repo`

#####`package_name`
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`
##### `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`
##### `service_names`

An array of services to start, normally `puppet` and `mcollective`. If the array is empty, no services are started.

#####`source`
##### `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:
``` puppet
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:
``` puppet
install_dir => 'D:\Program Files\Puppet Labs'
```

Alternate source from which you wish to download the latest version of Puppet.

## Limitations

Mac OS X Open Source packages are currently not supported.

###Known issues
### 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`.

Expand All @@ -148,18 +169,13 @@ In addition, there are several known issues with Windows:

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.
* AIX package names are based on PowerPC architecture version. PowerPC 8 is not yet supported.

##Development

Puppet Labs 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 of 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.
## Development

To contribute to the puppet_agent module, see [Contributing.md](https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/master/CONTRIBUTING.md). You can also read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing)
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.](https://docs.puppet.com/forge/contributing.html)

## Maintenance

Maintainers: Michael Smith <michael.smith@puppet.com>, Brandon High <brandon.high@puppet.com>
See [MAINTAINERS](MAINTAINERS)

Tickets: https://tickets.puppetlabs.com/browse/MODULES.
Tickets: https://tickets.puppetlabs.com/browse/MODULES
38 changes: 36 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ end

PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_puppet_url_without_modules')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.send('disable_only_variable_string')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "bundle/**/*", "vendor/**/*"]

PuppetSyntax.exclude_paths = ["spec/**/*.pp", "pkg/**/*.pp"]

Expand All @@ -49,3 +50,36 @@ task :test => [
:spec,
:metadata,
]

desc 'Generate pooler nodesets'
task :gen_nodeset do
require 'beaker-hostgenerator'
require 'securerandom'
require 'fileutils'

agent_target = ENV['TEST_TARGET']
if ! agent_target
STDERR.puts 'TEST_TARGET environment variable is not set'
STDERR.puts 'setting to default value of "redhat7-64default.a"'
agent_target = 'redhat7-64default.a'
end

master_target = ENV['MASTER_TEST_TARGET']
if ! master_target
STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
STDERR.puts 'setting to default value of "redhat7-64mdca"'
master_target = 'redhat7-64mcda'
end

targets = "#{master_target}-#{agent_target}"
cli = BeakerHostGenerator::CLI.new([targets])
nodeset_dir = "tmp/nodesets"
nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
FileUtils.mkdir_p(nodeset_dir)
File.open(nodeset, 'w') do |fh|
fh.print(cli.execute)
end
puts nodeset
puts "\n"
puts "do `export BEAKER_setfile=#{nodeset}` to use this nodeset with `rake beaker`"
end
29 changes: 29 additions & 0 deletions files/RPM-GPG-KEY-puppet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFe2Iz4BEADqbv/nWmR26bsivTDOLqrfBEvRu9kSfDMzYh9Bmik1A8Z036Eg
h5+TZD8Rrd5TErLQ6eZFmQXk9yKFoa9/C4aBjmsL/u0yeMmVb7/66i+x3eAYGLzV
FyunArjtefZyxq0B2mdRHE8kwl5XGl8015T5RGHCTEhpX14O9yigI7gtliRoZcl3
hfXtedcvweOf9VrV+t5LF4PrZejom8VcB5CE2pdQ+23KZD48+Cx/sHSLHDtahOTQ
5HgwOLK7rBll8djFgIqP/UvhOqnZGIsg4MzTvWd/vwanocfY8BPwwodpX6rPUrD2
aXPsaPeM3Q0juDnJT03c4i0jwCoYPg865sqBBrpOQyefxWD6UzGKYkZbaKeobrTB
xUKUlaz5agSK12j4N+cqVuZUBAWcokXLRrcftt55B8jz/Mwhx8kl6Qtrnzco9tBG
T5JN5vXMkETDjN/TqfB0D0OsLTYOp3jj4hpMp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gliqGcI1l2En62+6pI2x5XQqqiJ7+
=HpaX
-----END PGP PUBLIC KEY BLOCK-----
6 changes: 6 additions & 0 deletions lib/facter/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
end
end

Facter.add('puppet_stringify_facts') do
setcode do
Puppet.settings['stringify_facts'] || false
end
end

Facter.add('puppet_sslpaths') do
setcode do
result = {}
Expand Down
Loading