fast_finish: true
include:
- rvm: 1.8.7
- env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- - rvm: 1.8.7
- env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
+ env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
apt_key { 'puppetlabs':
ensure => 'present',
- id => '4BD6EC30',
+ id => '1054B7A24BD6EC30',
}
You can additionally set the following attributes:
the wget command that the old implementation depended on.
apt::key { 'puppetlabs':
- key => '4BD6EC30',
+ key => '1054B7A24BD6EC30',
key_server => 'pgp.mit.edu',
}
apt::key { 'jenkins':
- key => 'D50582E6',
+ key => '9B7D32F2D50582E6',
key_source => 'http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key',
}
release => 'unstable',
repos => 'main contrib non-free',
required_packages => 'debian-keyring debian-archive-keyring',
- key => '46925553',
+ key => '8B48AD6246925553',
key_server => 'subkeys.pgp.net',
pin => '-10',
include_src => true,
apt::source { 'puppetlabs':
location => 'http://apt.puppetlabs.com',
repos => 'main',
- key => '4BD6EC30',
+ key => '1054B7A24BD6EC30',
key_server => 'pgp.mit.edu',
}
release: 'unstable'
repos: 'main contrib non-free'
required_packages: 'debian-keyring debian-archive-keyring'
- key: '55BE302B'
+ key: '9AA38DCD55BE302B'
key_server: 'subkeys.pgp.net'
pin: '-10'
include_src: 'true'
'puppetlabs':
location: 'http://apt.puppetlabs.com'
repos: 'main'
- key: '4BD6EC30'
+ key: '1054B7A24BD6EC30'
key_server: 'pgp.mit.edu'
</pre>
apt::source { 'puppetlabs':
location => 'http://apt.puppetlabs.com',
repos => 'main',
- key => '4BD6EC30',
+ key => '1054B7A24BD6EC30',
key_server => 'pgp.mit.edu',
}
fail('$pin_priority must be an integer')
}
- $release_real = downcase($release)
- $key = $::lsbdistid ? {
+ if $::lsbdistid == 'LinuxMint' {
+ if $::lsbdistcodename == 'debian' {
+ $distid = 'debian'
+ $release_real = 'wheezy'
+ } else {
+ $distid = 'ubuntu'
+ $release_real = $::lsbdistcodename ? {
+ 'qiana' => 'trusty',
+ 'petra' => 'saucy',
+ 'olivia' => 'raring',
+ 'nadia' => 'quantal',
+ 'maya' => 'precise',
+ }
+ }
+ } else {
+ $distid = $::lsbdistid
+ $release_real = downcase($release)
+ }
+
+ $key = $distid ? {
'debian' => '46925553',
'ubuntu' => '437D05B5',
}
- $repos = $::lsbdistid ? {
+ $repos = $distid ? {
'debian' => 'main contrib non-free',
'ubuntu' => 'main universe multiverse restricted',
}
if $purge_preferences {
file { 'apt-preferences':
- ensure => absent,
- path => "${root}/preferences",
+ ensure => absent,
+ path => "${root}/preferences",
}
}
}
false: {
file { '99progressbar':
- ensure => absent,
- path => "${apt_conf_d}/99progressbar",
+ ensure => absent,
+ path => "${apt_conf_d}/99progressbar",
}
}
undef: {} # do nothing
case $proxy_host {
false, '', undef: {
file { '01proxy':
- ensure => absent,
- path => "${apt_conf_d}/01proxy",
- notify => Exec['apt_update'],
+ ensure => absent,
+ path => "${apt_conf_d}/01proxy",
+ notify => Exec['apt_update'],
}
}
default: {
}
file { 'old-proxy-file':
- ensure => absent,
- path => "${apt_conf_d}/proxy",
- notify => Exec['apt_update'],
+ ensure => absent,
+ path => "${apt_conf_d}/proxy",
+ notify => Exec['apt_update'],
}
# Need anchor to provide containment for dependencies.
$preferences_d = "${root}/preferences.d"
case $::lsbdistid {
+ 'ubuntu', 'debian': {
+ $distid = $::lsbdistid
+ $distcodename = $::lsbdistcodename
+ }
+ 'linuxmint': {
+ if $::lsbdistcodename == 'debian' {
+ $distid = 'debian'
+ $distcodename = 'wheezy'
+ } else {
+ $distid = 'ubuntu'
+ $distcodename = $::lsbdistcodename ? {
+ 'qiana' => 'trusty',
+ 'petra' => 'saucy',
+ 'olivia' => 'raring',
+ 'nadia' => 'quantal',
+ 'maya' => 'precise',
+ }
+ }
+ }
+ '': {
+ fail('Unable to determine lsbdistid, is lsb-release installed?')
+ }
+ default: {
+ fail("Unsupported lsbdistid (${::lsbdistid})")
+ }
+ }
+ case $distid {
'debian': {
- case $::lsbdistcodename {
+ case $distcodename {
'squeeze': {
$backports_location = 'http://backports.debian.org/debian-backports'
$legacy_origin = true
- $origins = ['${distro_id} oldstable',
- '${distro_id} ${distro_codename}-security',
- '${distro_id} ${distro_codename}-lts']
+ $origins = ['${distro_id} oldstable', #lint:ignore:single_quote_string_with_variables
+ '${distro_id} ${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
+ '${distro_id} ${distro_codename}-lts'] #lint:ignore:single_quote_string_with_variables
}
'wheezy': {
$backports_location = 'http://ftp.debian.org/debian/'
}
}
'ubuntu': {
- case $::lsbdistcodename {
+ case $distcodename {
'lucid': {
$backports_location = 'http://us.archive.ubuntu.com/ubuntu'
$ppa_options = undef
$legacy_origin = true
- $origins = ['${distro_id} ${distro_codename}-security']
+ $origins = ['${distro_id} ${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
}
'precise', 'trusty': {
$backports_location = 'http://us.archive.ubuntu.com/ubuntu'
$ppa_options = '-y'
$legacy_origin = true
- $origins = ['${distro_id}:${distro_codename}-security']
+ $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
}
default: {
$backports_location = 'http://old-releases.ubuntu.com/ubuntu'
$ppa_options = '-y'
$legacy_origin = true
- $origins = ['${distro_id}:${distro_codename}-security']
+ $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
}
}
}
- '': {
- fail('Unable to determine lsbdistid, is lsb-release installed?')
- }
- default: {
- fail("Unsupported lsbdistid (${::lsbdistid})")
- }
}
}
$proxy_env = []
}
exec { "add-apt-repository-${name}":
- environment => $proxy_env,
- command => "/usr/bin/add-apt-repository ${options} ${name}",
- unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
- user => 'root',
- logoutput => 'on_failure',
- notify => Exec['apt_update'],
- require => [
+ environment => $proxy_env,
+ command => "/usr/bin/add-apt-repository ${options} ${name}",
+ unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
+ user => 'root',
+ logoutput => 'on_failure',
+ notify => Exec['apt_update'],
+ require => [
File['sources.list.d'],
Package[$package],
],
}
end
+ describe "when turning on backports for linux mint debian edition" do
+
+ let :facts do
+ {
+ 'lsbdistcodename' => 'debian',
+ 'lsbdistid' => 'LinuxMint',
+ }
+ end
+
+ it { should contain_apt__source('backports').with({
+ 'location' => 'http://ftp.debian.org/debian/',
+ 'release' => 'wheezy-backports',
+ 'repos' => 'main contrib non-free',
+ 'key' => '46925553',
+ 'key_server' => 'pgp.mit.edu',
+ 'pin' => 200,
+ })
+ }
+ end
+
+ describe "when turning on backports for linux mint 17 (ubuntu-based)" do
+
+ let :facts do
+ {
+ 'lsbdistcodename' => 'qiana',
+ 'lsbdistid' => 'LinuxMint',
+ }
+ end
+
+ it { should contain_apt__source('backports').with({
+ 'location' => 'http://us.archive.ubuntu.com/ubuntu',
+ 'release' => 'trusty-backports',
+ 'repos' => 'main universe multiverse restricted',
+ 'key' => '437D05B5',
+ 'key_server' => 'pgp.mit.edu',
+ 'pin' => 200,
+ })
+ }
+ end
+
describe "when turning on backports for debian squeeze but using your own mirror" do
let :facts do
# Install Puppet
unless ENV['RS_PROVISION'] == 'no'
+ # This will install the latest available package on el and deb based
+ # systems fail on windows and osx, and install via gem on other *nixes
+ foss_opts = { :default_action => 'gem_install' }
+
+ if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
+
hosts.each do |host|
- if host.is_pe?
- install_pe
- else
- install_puppet
- on host, "mkdir -p #{host['distmoduledir']}"
- end
+ on host, "mkdir -p #{host['distmoduledir']}"
end
end