Skip to content
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

(PE-10132) Remove old PE 3.8 repo #46

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions manifests/osfamily/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
content => $_apt_settings.join(''),
priority => 90,
}

# Due to the file paths changing on the PE Master, the 3.8 repository is no longer valid.
# On upgrade, remove the repo file so that a dangling reference is not left behind returning
# a 404 on subsequent runs.

# Pass in an empty content string since apt requires it even though we are removing it
apt::setting {'list-puppet-enterprise-installer':
ensure => absent,
content => '',
}

apt::setting { 'conf-pe-repo':
ensure => absent,
priority => '90',
content => '',
}
}
else {
$source = $::puppet_agent::source ? {
Expand Down
7 changes: 7 additions & 0 deletions manifests/osfamily/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

$pe_server_version = pe_build_version()
$source = "${::puppet_agent::source}/${pe_server_version}/${::platform_tag}"

# Due to the file paths changing on the PE Master, the 3.8 repository is no longer valid.
# On upgrade, remove the repo file so that a dangling reference is not left behind returning
# a 404 on subsequent runs.
yumrepo { 'puppetlabs-pepackages':
ensure => absent,
}
}
else {
$source = $::puppet_agent::source ? {
Expand Down
14 changes: 14 additions & 0 deletions spec/classes/puppet_agent_osfamily_debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
})
}

it { is_expected.to contain_apt__setting('conf-pe-repo').with({
'priority' => 90,
'content' => '',
'ensure' => 'absent',
}) }

it { is_expected.to contain_apt__setting('list-puppet-enterprise-installer').with({
'content' => '',
'ensure' => 'absent',
}) }

apt_settings = [
"Acquire::https::master.example.vm::CaInfo \"/etc/puppetlabs/puppet/ssl/certs/ca.pem\";",
"Acquire::https::master.example.vm::SslCert \"/etc/puppetlabs/puppet/ssl/certs/foo.example.vm.pem\";",
Expand All @@ -57,6 +68,9 @@
end

context 'when FOSS' do
it { is_expected.not_to contain_apt__setting('conf-pe-repo') }
it { is_expected.not_to contain_apt__setting('list-puppet-enterprise-installer') }

it { is_expected.to contain_apt__source('pc1_repo').with({
'location' => 'http://apt.puppetlabs.com',
'repos' => 'PC1',
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/puppet_agent_osfamily_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
}) }

context 'when FOSS' do
it { is_expected.not_to contain_yumrepo('puppetlabs-pepackages').with_ensure('absent') }
it { is_expected.to contain_yumrepo('pc1_repo').with({
'baseurl' => "https://yum.puppetlabs.com/#{urlbit}/PC1/x64",
'enabled' => 'true',
Expand Down Expand Up @@ -63,6 +64,8 @@
})
}

it { is_expected.to contain_yumrepo('puppetlabs-pepackages').with_ensure('absent') }

it { is_expected.to contain_yumrepo('pc1_repo').with({
'baseurl' => "https://master.example.vm:8140/packages/4.0.0/el-7-x86_64",
'enabled' => 'true',
Expand Down