-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from mwbutcher/issue/master/pe-10914-add-osx-1…
…09-upgrade Issue/master/pe 10914 add osx 109 upgrade
- Loading branch information
Showing
9 changed files
with
235 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# == Class puppet_agent::install::remove_packages_osx | ||
# | ||
# Sadly, special handling is required to clear up puppet_enterprise installation | ||
# on 3.8. | ||
# | ||
class puppet_agent::install::remove_packages_osx { | ||
assert_private() | ||
|
||
if $::puppet_agent::is_pe { | ||
# shutdown services | ||
service { 'pe-puppet': | ||
ensure => stopped, | ||
}-> | ||
service { 'pe-mcollective': | ||
ensure => stopped, | ||
}-> | ||
|
||
# remove old users and groups | ||
user { 'pe-puppet': | ||
ensure => absent, | ||
}-> | ||
user { 'pe-mcollective': | ||
ensure => absent, | ||
}-> | ||
|
||
# remove old /opt/puppet files | ||
file { '/opt/puppet': | ||
ensure => absent, | ||
force => true, | ||
backup => false, | ||
} | ||
# Can't delete /var/opt/lib/pe-puppet or we get errors because | ||
# /var/opt/lib/pe-puppet/state is missing when puppet run tries to save | ||
# report | ||
|
||
# forget packages | ||
[ | ||
'pe-augeas', | ||
'pe-ruby-augeas', | ||
'pe-openssl', | ||
'pe-ruby', | ||
'pe-cfpropertylist', | ||
'pe-facter', | ||
'pe-puppet', | ||
'pe-mcollective', | ||
'pe-hiera', | ||
'pe-puppet-enterprise-release', | ||
'pe-stomp', | ||
'pe-libyaml', | ||
'pe-ruby-rgen', | ||
'pe-deep-merge', | ||
'pe-ruby-shadow', | ||
].each |$package| { | ||
exec { "forget ${package}": | ||
command => "/usr/sbin/pkgutil --forget com.puppetlabs.${package}", | ||
require => File['/opt/puppet'], | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class puppet_agent::osfamily::darwin( | ||
$package_file_name = undef, | ||
) { | ||
assert_private() | ||
|
||
if $::macosx_productversion_major !~ '10\.[9,10,11]' { | ||
fail("${::macosx_productname} ${::maxosx_productversion_major} not supported") | ||
} | ||
|
||
class { 'puppet_agent::prepare::package': | ||
package_file_name => $package_file_name, | ||
} | ||
contain puppet_agent::prepare::package | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
require 'spec_helper' | ||
|
||
describe 'puppet_agent', :unless => Puppet.version < "3.8.0" || Puppet.version >= "4.0.0" do | ||
before(:each) do | ||
# Need to mock the PE functions | ||
Puppet::Parser::Functions.newfunction(:pe_build_version, :type => :rvalue) do |args| | ||
"4.0.0" | ||
end | ||
|
||
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, :type => :rvalue) do |args| | ||
'1.2.5' | ||
end | ||
end | ||
|
||
facts = { | ||
:is_pe => true, | ||
:osfamily => 'Darwin', | ||
:operatingsystem => 'Darwin', | ||
:macosx_productversion_major => '10.9', | ||
:architecture => 'x86_64', | ||
:servername => 'master.example.vm', | ||
:clientcert => 'foo.example.vm', | ||
} | ||
|
||
describe 'unsupported environment' do | ||
context "when OSX 10.8" do | ||
let(:facts) do | ||
facts.merge({ | ||
:platform_tag => "osx-10.8-x86_64", | ||
:macosx_productversion_major => '10.8', | ||
}) | ||
end | ||
|
||
it { expect { catalogue }.to raise_error(/not supported/) } | ||
end | ||
end | ||
|
||
describe 'supported environment' do | ||
context "when OSX 10.9" do | ||
let(:facts) do | ||
facts.merge({ | ||
:is_pe => true, | ||
:platform_tag => "osx-10.9-x86_64", | ||
:macosx_productversion_major => '10.9', | ||
}) | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
it { is_expected.to contain_package('puppet-agent').with_source('/opt/puppetlabs/packages/puppet-agent-1.2.5-1.osx10.9.dmg') } | ||
end | ||
|
||
context "when OSX 10.10" do | ||
let(:facts) do | ||
facts.merge({ | ||
:is_pe => true, | ||
:platform_tag => "osx-10.10-x86_64", | ||
:macosx_productversion_major => '10.10', | ||
}) | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
it { is_expected.to contain_package('puppet-agent').with_source('/opt/puppetlabs/packages/puppet-agent-1.2.5-1.osx10.10.dmg') } | ||
end | ||
|
||
context "when OSX 10.11" do | ||
let(:facts) do | ||
facts.merge({ | ||
:is_pe => true, | ||
:platform_tag => "osx-10.11-x86_64", | ||
:macosx_productversion_major => '10.11', | ||
}) | ||
end | ||
|
||
it { should compile.with_all_deps } | ||
it { is_expected.to contain_package('puppet-agent').with_source('/opt/puppetlabs/packages/puppet-agent-1.2.5-1.osx10.11.dmg') } | ||
end | ||
end | ||
end |