-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/master/pe 10914 add osx 109 upgrade #70
Merged
highb
merged 1 commit into
puppetlabs:master
from
mwbutcher:issue/master/pe-10914-add-osx-109-upgrade
Dec 8, 2015
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, the puppet osx package provider doesn't handle this? I'm disappointed. :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR's welcome. Unfortunately figuring out the signature of an installed package from a package name, without keeping state or running the installer, is a mystery to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should say I'm more disappointed in Apple for not writing a real package manager. It's definitely a hard problem to solve. Is there any way of getting a listing of all installed signatures so you could regex for
package_name
and uninstall if there is only one match?