From 79890bc7ae18e0aa0de72e097f9b37769f8812f5 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 23 Mar 2015 15:24:35 -0400 Subject: [PATCH 1/7] We got rid of the funny proxy removal --- examples/proxy.pp | 1 - 1 file changed, 1 deletion(-) delete mode 100644 examples/proxy.pp diff --git a/examples/proxy.pp b/examples/proxy.pp deleted file mode 100644 index 464090415c..0000000000 --- a/examples/proxy.pp +++ /dev/null @@ -1 +0,0 @@ -# TODO From 556c1adfaacde722b0a7d4e1b674fd361486cd91 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 23 Mar 2015 16:13:37 -0400 Subject: [PATCH 2/7] Add an example for backports --- examples/backports.pp | 69 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/examples/backports.pp b/examples/backports.pp index 464090415c..819d43f64b 100644 --- a/examples/backports.pp +++ b/examples/backports.pp @@ -1 +1,68 @@ -# TODO +# If your environment includes mint you'll need something more like this: +# +#$location = $::lsbdistcodename ? { +# 'squeeze' => 'http://backports.debian.org/debian-backports', +# 'wheezy' => 'http://ftp.debian.org/debian/', +# 'debian' => 'http://ftp.debian.org/debian/', #thanks LinuxMint +# default => 'http://us.archive.ubuntu.com/ubuntu', +#} +# +#if ($::lsbdistid == 'LinuxMint' and $::lsbdistcodename == 'debian') or $::lsbdistid == 'Debian' { +# $repos = 'main contrib non-free' +# $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' +# if $::lsbdistid == 'LinuxMint' { +# $release = 'wheezy' +# } else { +# $release = downcase($::lsbdistrelease) +# } +#} else { +# if $::lsbdistid == 'LinuxMint' { +# $release = $::lsbdistcodename ? { +# 'qiana' => 'trusty', +# 'petra' => 'saucy', +# 'olivia' => 'raring', +# 'nadia' => 'quantal', +# 'maya' => 'precise', +# } +# } else { +# $release = downcase($::lsbdistrelease) +# } +# $repos = 'main universe multiverse restricted' +# $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' +#} + +## Start logic to figure out backports location, repos, key, and release +if $::lsbdistid == 'Debian' { + $repos = 'main contrib non-free' + $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' + $release = downcase($::lsbdistrelease) + $location = $::lsbdistcodename ? { + 'squeeze' => 'http://backports.debian.org/debian-backports', + 'wheezy' => 'http://ftp.debian.org/debian/', + default => 'http://http.debian.net/debian/', + } +} else { + $release = downcase($::lsbdistrelease) + $repos = 'main universe multiverse restricted' + $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' + $location = 'http://us.archive.ubuntu.com/ubuntu', +} +## end logic for variables + + +# set up the actual backports +apt::pin { 'backports': + before => Apt::Source['backports'], + release => "${release}-backports", + priority => 200, +} + +apt::source { 'backports': + location => $location, + release => "${release}-backports", + repos => $repos, + key => { + id => $key, + server => 'pgp.mit.edu', + }, +} From 411679c3c012e945f5a24c53c4bff2e9db11f68f Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 25 Mar 2015 11:13:12 -0400 Subject: [PATCH 3/7] We've got things in params, let's use those! --- examples/backports.pp | 60 +++++++++---------------------------------- 1 file changed, 12 insertions(+), 48 deletions(-) diff --git a/examples/backports.pp b/examples/backports.pp index 819d43f64b..f3ca34cb77 100644 --- a/examples/backports.pp +++ b/examples/backports.pp @@ -1,54 +1,18 @@ -# If your environment includes mint you'll need something more like this: -# -#$location = $::lsbdistcodename ? { -# 'squeeze' => 'http://backports.debian.org/debian-backports', -# 'wheezy' => 'http://ftp.debian.org/debian/', -# 'debian' => 'http://ftp.debian.org/debian/', #thanks LinuxMint -# default => 'http://us.archive.ubuntu.com/ubuntu', -#} -# -#if ($::lsbdistid == 'LinuxMint' and $::lsbdistcodename == 'debian') or $::lsbdistid == 'Debian' { -# $repos = 'main contrib non-free' -# $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' -# if $::lsbdistid == 'LinuxMint' { -# $release = 'wheezy' -# } else { -# $release = downcase($::lsbdistrelease) -# } -#} else { -# if $::lsbdistid == 'LinuxMint' { -# $release = $::lsbdistcodename ? { -# 'qiana' => 'trusty', -# 'petra' => 'saucy', -# 'olivia' => 'raring', -# 'nadia' => 'quantal', -# 'maya' => 'precise', -# } -# } else { -# $release = downcase($::lsbdistrelease) -# } -# $repos = 'main universe multiverse restricted' -# $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' -#} +$location = $::apt::distcodename ? { + 'squeeze' => 'http://backports.debian.org/debian-backports', + 'wheezy' => 'http://ftp.debian.org/debian/', + default => 'http://us.archive.ubuntu.com/ubuntu', +} -## Start logic to figure out backports location, repos, key, and release -if $::lsbdistid == 'Debian' { - $repos = 'main contrib non-free' - $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' - $release = downcase($::lsbdistrelease) - $location = $::lsbdistcodename ? { - 'squeeze' => 'http://backports.debian.org/debian-backports', - 'wheezy' => 'http://ftp.debian.org/debian/', - default => 'http://http.debian.net/debian/', - } +if $::apt::distid == 'debian' { + $repos = 'main contrib non-free' + $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' + $release = $::apt::distcodename } else { - $release = downcase($::lsbdistrelease) - $repos = 'main universe multiverse restricted' - $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' - $location = 'http://us.archive.ubuntu.com/ubuntu', + $repos = 'main universe multiverse restricted' + $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' + $release = $::apt::distcodename } -## end logic for variables - # set up the actual backports apt::pin { 'backports': From 895ecb5737cee2a2b82fb943483e4776e9eb9083 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 25 Mar 2015 13:08:13 -0400 Subject: [PATCH 4/7] Add examples for force. --- examples/force.pp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/examples/force.pp b/examples/force.pp index 36d23f8546..355d91f03a 100644 --- a/examples/force.pp +++ b/examples/force.pp @@ -1,2 +1,28 @@ -# force.pp -# TODO: Update +#if you need to specify a release +$rel_string = "-t ${release}" +#else +$rel_string = '' + +#if you need to specify a version +$ensure = $version +#else +$ensure = installed + +#if overwrite existing cfg files +$config_files = '-o Dpkg::Options::="--force-confnew"' +#elsif force use of old files +$config_files = '-o Dpkg::Options::="--force-confold"' +#elsif update only unchanged files +$config_files = '-o Dpkg::Options::="--force-confdef"' +#else +$config_files = '' + +#if install missing configuration files for the package +$config_missing = '-o Dpkg::Options::="--force-confmiss"' +#else +$config_missing = '' + +package { $package: + ensure => $ensure, + install_options => "${config_files} ${config_missing} ${release_string}", +} From 1b4d8ba991c2072ec0e3347e48f1aca148970929 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 25 Mar 2015 15:16:04 -0400 Subject: [PATCH 5/7] Example for disabling keys --- examples/disable_keys.pp | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 examples/disable_keys.pp diff --git a/examples/disable_keys.pp b/examples/disable_keys.pp new file mode 100644 index 0000000000..ad61df0421 --- /dev/null +++ b/examples/disable_keys.pp @@ -0,0 +1,5 @@ +#Note: This is generally a bad idea. You should not disable keys. +apt::conf { 'unauth': + priority => 99, + content => 'APT::Get::AllowUnauthenticated 1;' +} From 073e8f162ad9c232a09af819946a691467407472 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 25 Mar 2015 15:30:16 -0400 Subject: [PATCH 6/7] Example for fancy progress. --- examples/fancy_progress.pp | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 examples/fancy_progress.pp diff --git a/examples/fancy_progress.pp b/examples/fancy_progress.pp new file mode 100644 index 0000000000..db78441b6b --- /dev/null +++ b/examples/fancy_progress.pp @@ -0,0 +1,4 @@ +apt::conf { 'progressbar': + priority => 99, + content => 'Dpkg::Progress-Fancy "1";', +} From 0f26779a2a9a7b73505dc87284f4baa4eb9842b0 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 25 Mar 2015 17:22:52 -0400 Subject: [PATCH 7/7] Example updates --- examples/backports.pp | 7 +++---- examples/disable_keys.pp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/backports.pp b/examples/backports.pp index f3ca34cb77..ed8213f0fa 100644 --- a/examples/backports.pp +++ b/examples/backports.pp @@ -1,7 +1,7 @@ $location = $::apt::distcodename ? { 'squeeze' => 'http://backports.debian.org/debian-backports', 'wheezy' => 'http://ftp.debian.org/debian/', - default => 'http://us.archive.ubuntu.com/ubuntu', + default => 'http://archive.ubuntu.com/ubuntu', } if $::apt::distid == 'debian' { @@ -16,7 +16,6 @@ # set up the actual backports apt::pin { 'backports': - before => Apt::Source['backports'], release => "${release}-backports", priority => 200, } @@ -26,7 +25,7 @@ release => "${release}-backports", repos => $repos, key => { - id => $key, - server => 'pgp.mit.edu', + id => $key, + server => 'pgp.mit.edu', }, } diff --git a/examples/disable_keys.pp b/examples/disable_keys.pp index ad61df0421..50d0ea8022 100644 --- a/examples/disable_keys.pp +++ b/examples/disable_keys.pp @@ -1,4 +1,4 @@ -#Note: This is generally a bad idea. You should not disable keys. +#Note: This is generally a bad idea. You should not disable verifying repository signatures. apt::conf { 'unauth': priority => 99, content => 'APT::Get::AllowUnauthenticated 1;'