Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
PUP-293 refactored installation
Browse files Browse the repository at this point in the history
  • Loading branch information
aharden committed Jul 10, 2015
1 parent 0e3d302 commit 028fc79
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 514 deletions.
48 changes: 15 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The puppet\_ent\_agent module is dependent on the PE Package Repositories (pe_re
###What puppet\_ent\_agent affects

* pe-agent package (and pe-\* packages related to PE)
* /etc/puppetlabs/puppet/puppet.conf configuration file.
* puppet.conf configuration file.
* pe-puppet service.

###Beginning with puppet\_ent\_agent
Expand All @@ -31,6 +31,7 @@ The puppet\_ent\_agent module is dependent on the PE Package Repositories (pe_re
```puppet
class { '::puppet_ent_agent':
agent_caserver => 'puppetca.company.lan',
ensure => '3.8.1'
windows_source => '\\myfileserver\pe-agent'
}
```
Expand All @@ -47,39 +48,20 @@ Path to the puppet.conf file. Defaults:

####`ensure`

Default setting: 'latest'
Default setting: 'present'

To disable PE agent upgrades, set this to 'present'.
To disable PE agent upgrades, leave this set to 'present'.

#####For Debian/RedHat OS families:
Version of pe-agent to ensure, by default will use the 'current' package
repository on the master. *This will auto-upgrade agents if master is updated.*
To upgrade managed agents to a specific PE version, specify a PE agent version
available on your pe_repo PE masters and/or Windows PE agent source.

######Advanced Usage:
If you specify a version number, it must match the package's versioning. E.g.,
PE agent 3.7.2 package version for Ubuntu is '3.7.2-1puppet1'. The
`repo_version` parameter must be specified if a package version number is used.

#####For AIX/Solaris/Windows OS families:
These OS's don't support packages; if managing agent installation on them, set
`ensure` to the desired version of the PE agent.

####`repo_version`

Only used on Debian/RedHat OS families when a package version number is
specified in `ensure`. Selects the pe_repo package repository to use; this
version must already be present on the pe_repo server. This module does not
manage pe_repo.

To use a version of the package repository other than the one linked to
'current', set this parameter to the corresponding Puppet Enterprise release.
E.g., '3.7.2' for PE 3.7.2 agents.
If the pe_repo package repository of the specified version is not present on
the pe_repo server, the module will fail. This module does not manage pe_repo.

####`master`

Hostname of apt/yum repository with pe-agent packages on it, assumes the hostname is of a PE master
with the required pe_repo classes properly applied to it. Defaults to the PE master that compiled
the agent's catalog.
Hostname of a PE master with the required pe_repo classes properly applied to
it. Defaults to the PE master that compiled the agent's catalog.

####`agent_server` & `agent_caserver` & `agent_fileserver` & `agent_environment`

Expand All @@ -89,8 +71,8 @@ The server settings default to undef and do not manage the settings unless overr

####`staging_dir`

The directory that will be used on AIX and Solaris hosts to temporarily hold the
PE Agent installation files. This defaults to PE's default: /tmp/puppet-enterprise-installer
The directory that will be used on non-Windows hosts to temporarily hold the
PE Agent installation script. This defaults to '/tmp'.

####`windows_source`

Expand Down Expand Up @@ -119,6 +101,6 @@ Windows support requires the MSI installers for the PE Agent for Windows to be h
outside of the PE environment. PowerShell is required for upgrade support.

AIX, Debian/Ubuntu, and Windows OS Families have been tested. RedHat and Solaris
testing is in progress. Windows support was changed to a scheduled task after it was
found that managing the PE agent as a Puppet package resource produced unpredictable
behavior and is not supported by Puppet Labs.
testing is in progress, but should work. Windows support was changed to a scheduled
task after it was found that managing the PE agent as a Puppet package resource produced
unpredictable behavior and is not supported by Puppet Labs.
30 changes: 0 additions & 30 deletions files/puppet-enterprise.gpg.key

This file was deleted.

28 changes: 0 additions & 28 deletions manifests/aix.pp

This file was deleted.

38 changes: 0 additions & 38 deletions manifests/apt.pp

This file was deleted.

4 changes: 0 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
$config = $puppet_ent_agent::params::config,
$ensure = $puppet_ent_agent::params::ensure,
$master = $puppet_ent_agent::params::master,
$repo_name = $puppet_ent_agent::params::repo_name,
$repo_version = $puppet_ent_agent::params::repo_version,
$agent_server = $puppet_ent_agent::params::agent_server,
$agent_caserver = $puppet_ent_agent::params::agent_caserver,
$agent_fileserver = $puppet_ent_agent::params::agent_fileserver,
Expand All @@ -31,8 +29,6 @@
validate_absolute_path($config)
validate_string($ensure)
validate_string($master)
validate_string($repo_name)
validate_string($repo_version)
validate_string($agent_server)
validate_string($agent_caserver)
validate_string($agent_fileserver)
Expand Down
31 changes: 5 additions & 26 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,16 @@
$windows_source = $::puppet_ent_agent::windows_source

if $ensure != 'present' {
include ::puppet_ent_agent::repo

case $::osfamily {
'AIX','Debian','Solaris','Windows': {
if $ensure != 'latest' {
case $::osfamily {
'AIX','Solaris': { include ::puppet_ent_agent::nix }
'Debian': { include ::puppet_ent_agent::curl }
#'Solaris': { include ::puppet_ent_agent::solaris }
'windows': {
if $windows_source {
include ::puppet_ent_agent::windows
}
else {
notify { 'Windows repository not available: source not defined.': }
}
}
default: {}
}
}
'windows': {
if $windows_source {
include ::puppet_ent_agent::install::windows
else {
notify { "Must specify PE agent version on ${::osfamily}": }
}
}
'RedHat' : {
package { 'pe-agent':
ensure => $ensure,
notify { 'Windows repository not available: source not defined.': }
}
}
default: {
notify { "Unsupported OS family ${::osfamily}.": }
include ::puppet_ent_agent::install::nix
}
}
}
Expand Down
9 changes: 1 addition & 8 deletions manifests/curl.pp → manifests/install/nix.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Download bash script from pe_repo and run it
class puppet_ent_agent::curl inherits puppet_ent_agent {
class puppet_ent_agent::install::nix inherits puppet_ent_agent {
$master = $::puppet_ent_agent::master
$staging_dir = $::puppet_ent_agent::staging_dir
$version = $::puppet_ent_agent::ensure
Expand Down Expand Up @@ -27,13 +27,6 @@
verbose => false,
nocheckcertificate => true,
} ->
# file { "${staging_dir}/install.bash":
# ensure => file,
# owner => 'root',
# group => $group,
# mode => '0644',
# content => template("${module_name}/install.bash.erb"),
# } ->
exec { "/bin/bash -e ${staging_dir}/install.bash":
user => 'root',
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/windows.pp → manifests/install/windows.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Note: PE has only a 32-bit installer until v3.7.0
# Includes code from https://forge.puppetlabs.com/opentable/puppetversion
# (Thanks, opentable!)
class puppet_ent_agent::windows inherits puppet_ent_agent {
class puppet_ent_agent::install::windows inherits puppet_ent_agent {
$master = $::puppet_ent_agent::master
$version = $::puppet_ent_agent::ensure
$windows_source = $::puppet_ent_agent::windows_source
Expand Down
53 changes: 0 additions & 53 deletions manifests/nix.pp

This file was deleted.

4 changes: 1 addition & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@
}
$ensure = 'latest'
$master = $::settings::server
$repo_name = 'puppetlabs-pepackages'
$repo_version = undef
$agent_server = undef
$agent_caserver = undef
$agent_fileserver = undef
$agent_environment = 'production'
$staging_dir = '/tmp/puppet-enterprise-installer'
$staging_dir = '/tmp'
$windows_source = undef
$windows_task_min = '10' # run a scheduled task to upgrade PE agent in x mins
}
13 changes: 0 additions & 13 deletions manifests/repo.pp

This file was deleted.

35 changes: 0 additions & 35 deletions manifests/solaris.pp

This file was deleted.

Loading

0 comments on commit 028fc79

Please sign in to comment.