Skip to content

Commit

Permalink
(PE-12002) Add AIX support
Browse files Browse the repository at this point in the history
This change adds puppet agent support for AIX.

Support is gated by the 'aix' operatingsystem fact
and an archetecture fact matching 'PowerPC_POWER[5,6,7]'.

This change uses the same strategy as sles for removing
unused packages as aix doesn't have fully fledged package
management for rpms.
  • Loading branch information
mwbutcher committed Jan 6, 2016
1 parent 075bca1 commit a83b9a3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$source = $::puppet_agent::params::_source,
) inherits ::puppet_agent::params {

validate_re($arch, ['^x86$','^x64$','^i386$','^i86pc$','^amd64$','^x86_64$','^power$', '^sun4[uv]$'])
validate_re($arch, ['^x86$','^x64$','^i386$','^i86pc$','^amd64$','^x86_64$','^power$','^sun4[uv]$','PowerPC_POWER'])

if versioncmp("${::clientversion}", '3.8.0') < 0 {
fail('upgrading requires Puppet 3.8')
Expand Down Expand Up @@ -49,6 +49,9 @@
}
} elsif $::operatingsystem == 'Darwin' and $::macosx_productversion_major =~ '10\.[9,10,11]' {
$_package_file_name = "${puppet_agent::package_name}-${puppet_agent::params::master_agent_version}-1.osx${$::macosx_productversion_major}.dmg"
} elsif $::operatingsystem == 'aix' and $::architecture =~ 'PowerPC_POWER[5,6,7]' {
$aix_ver_number = regsubst($::platform_tag,'aix-(\d+\.\d+)-power','\1')
$_package_file_name = "${puppet_agent::package_name}-${puppet_agent::params::master_agent_version}-1.aix${aix_ver_number}.ppc.rpm"
} else {
$_package_file_name = undef
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
) {
assert_private()

if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '10' {
if ($::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '10') or ($::operatingsystem == 'AIX' and $::architecture =~ 'PowerPC_POWER[5,6,7]') {
contain puppet_agent::install::remove_packages

exec { 'replace puppet.conf removed by package removal':
Expand Down
4 changes: 4 additions & 0 deletions manifests/install/remove_packages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
uninstall_options => '--nodeps',
provider => 'rpm',
},
'AIX' => {
uninstall_options => '--nodeps',
provider => 'rpm',
},
'Solaris' => {
adminfile => '/opt/puppetlabs/packages/solaris-noask',
},
Expand Down
16 changes: 16 additions & 0 deletions manifests/osfamily/aix.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class puppet_agent::osfamily::aix(
$package_file_name = undef,
) {
assert_private()

class { 'puppet_agent::prepare::package':
package_file_name => $package_file_name,
}

contain puppet_agent::prepare::package

file { '/usr/local/bin/puppet':
ensure => 'link',
target => '/opt/puppetlabs/bin/puppet',
}
}
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

case $::osfamily {
'RedHat', 'Amazon', 'Debian', 'Suse', 'Solaris', 'Darwin': {
'RedHat', 'Amazon', 'Debian', 'Suse', 'Solaris', 'Darwin', 'AIX': {
$package_name = 'puppet-agent'
$service_names = ['puppet', 'mcollective']

Expand Down

0 comments on commit a83b9a3

Please sign in to comment.