From 1ac72986c49b036399b78f108cbf1332840f13d4 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sat, 21 Apr 2012 05:54:28 -0400 Subject: Apply GPL-v3 license Signed-off-by: Gabriel Filion --- README | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README') diff --git a/README b/README index fdae462..75d9329 100644 --- a/README +++ b/README @@ -391,3 +391,15 @@ this resource so you don't have to manage this yourself if you need to make sure APT indexes are up-to-date before a package upgrade is attempted, but don't want "apt-get update" to happen on every Puppet run. + + +Licensing +========= + +This puppet module is licensed under the GPL version 3 or later. Redistribution +and modification is encouraged. + +The GPL version 3 license text can be found in the "LICENSE" file accompanying +this puppet module, or at the following URL: + +http://www.gnu.org/licenses/gpl-3.0.html -- cgit v1.2.3 From 0cb3cd816e37a81ffc89e68b774d34930c5acc36 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 15 Apr 2012 15:41:58 +0200 Subject: Migrate - in class names to _ In newer puppet releases the old way to name class/modules with a -, won't anymore be supported. Conflicts: manifests/unattended_upgrades.pp --- README | 30 +++++++++++++++--------------- manifests/cron/dist-upgrade.pp | 23 ----------------------- manifests/cron/dist_upgrade.pp | 23 +++++++++++++++++++++++ manifests/dist_upgrade/initiator.pp | 4 ++-- manifests/init.pp | 12 ++++++------ manifests/preseeded_package.pp | 2 +- manifests/unattended_upgrades.pp | 4 ++-- 7 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 manifests/cron/dist-upgrade.pp create mode 100644 manifests/cron/dist_upgrade.pp (limited to 'README') diff --git a/README b/README index 75d9329..bdb8185 100644 --- a/README +++ b/README @@ -36,11 +36,11 @@ From apt.conf(5), 0.7.2: packages." To change the default setting for DSelect::Clean, you can create a file named -"03clean" or "03clean_vserver" in your site-apt module's files directory. You +"03clean" or "03clean_vserver" in your site_apt module's files directory. You can also define this for a specific host by creating a file in a subdirectory of -the site-apt modules' files directory that is named the same as the -host. (example: site-apt/files/some.host.com/03clean, or -site-apt/files/some.host.com/03clean_vserver) +the site_apt modules' files directory that is named the same as the +host. (example: site_apt/files/some.host.com/03clean, or +site_apt/files/some.host.com/03clean_vserver) Variables ========= @@ -61,9 +61,9 @@ e.g. changing the sections included in the source, etc. you can set this variable to the content that you desire to use instead. For example, setting the following variable before including this class will -pull in the templates/site-apt/sources.list file: +pull in the templates/site_apt/sources.list file: - $custom_sources_list = template("site-apt/sources.list") + $custom_sources_list = template("site_apt/sources.list") $custom_preferences ------------------- @@ -77,8 +77,8 @@ unless you explicitly specify the version number. This file will be complemented with all of the preferences_snippet calls (see below). If the default preferences template doesn't suit your needs, you can create a -template located in your site-apt module, and set $custom_preferences with the -content (eg. $custom_preferences = template('site-apt/preferences') ) +template located in your site_apt module, and set $custom_preferences with the +content (eg. $custom_preferences = template('site_apt/preferences') ) Setting this variable to false before including this class will force the apt/preferences file to be absent: @@ -198,7 +198,7 @@ be passed as the "hours" parameter of a cronjob. Example: Note that the default 4 AM cronjob won't be disabled. -apt::cron::dist-upgrade +apt::cron::dist_upgrade ----------------------- This class sets up cron-apt so that it dist-upgrades the system and @@ -230,8 +230,8 @@ file's content changes. The initiator file is copied from the first available source amongst the following ones, in decreasing priority order: -- puppet:///site-apt/${fqdn}/upgrade_initiator -- puppet:///site-apt/upgrade_initiator +- puppet:///site_apt/${fqdn}/upgrade_initiator +- puppet:///site_apt/upgrade_initiator - puppet:///apt/upgrade_initiator This is useful when one does not want to setup a fully automated @@ -298,7 +298,7 @@ meta-parameter to define content inline or with the help of a template. Example: apt::apt_conf { "80download-only": - source => "puppet:///modules/site-apt/80download-only", + source => "puppet:///modules/site_apt/80download-only", } apt::preferences_snippet @@ -320,7 +320,7 @@ apt::preseeded_package This simplifies installation of packages for which you wish to preseed the answers to debconf. For example, if you wish to provide a preseed file for the locales package, you would place the locales.seed file in -'site-apt/templates/$lsbdistcodename/locales.seeds' and then include the +'site_apt/templates/$lsbdistcodename/locales.seeds' and then include the following in your manifest: apt::preseeded_package { locales: } @@ -343,8 +343,8 @@ meta-parameter to define content inline or with the help of a template. Example: apt::sources_list { "company_internals.list": - source => ["puppet:///modules/site-apt/${fqdn}/company_internals.list", - "puppet:///modules/site-apt/company_internals.list"], + source => ["puppet:///modules/site_apt/${fqdn}/company_internals.list", + "puppet:///modules/site_apt/company_internals.list"], } apt::upgrade_package diff --git a/manifests/cron/dist-upgrade.pp b/manifests/cron/dist-upgrade.pp deleted file mode 100644 index 2568cb7..0000000 --- a/manifests/cron/dist-upgrade.pp +++ /dev/null @@ -1,23 +0,0 @@ -class apt::cron::dist-upgrade inherits apt::cron::base { - - $action = "autoclean -y -dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-confold' -" - - file { "/etc/cron-apt/action.d/3-download": - ensure => absent, - } - - package { "apt-listbugs": ensure => absent } - - config_file { "/etc/cron-apt/action.d/4-dist-upgrade": - content => $action, - require => Package[cron-apt] - } - - config_file { "/etc/cron-apt/config.d/MAILON": - content => "MAILON=upgrade\n", - require => Package[cron-apt] - } - -} diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp new file mode 100644 index 0000000..1c8adb1 --- /dev/null +++ b/manifests/cron/dist_upgrade.pp @@ -0,0 +1,23 @@ +class apt::cron::dist_upgrade inherits apt::cron::base { + + $action = "autoclean -y +dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-confold' +" + + file { "/etc/cron-apt/action.d/3-download": + ensure => absent, + } + + package { "apt-listbugs": ensure => absent } + + config_file { "/etc/cron-apt/action.d/4-dist-upgrade": + content => $action, + require => Package[cron-apt] + } + + config_file { "/etc/cron-apt/config.d/MAILON": + content => "MAILON=upgrade\n", + require => Package[cron-apt] + } + +} diff --git a/manifests/dist_upgrade/initiator.pp b/manifests/dist_upgrade/initiator.pp index 6d57947..571cd51 100644 --- a/manifests/dist_upgrade/initiator.pp +++ b/manifests/dist_upgrade/initiator.pp @@ -10,8 +10,8 @@ class apt::dist_upgrade::initiator inherits apt::dist_upgrade { path => "${initiator_abs}", checksum => md5, source => [ - "puppet:///modules/site-apt/${fqdn}/${initiator}", - "puppet:///modules/site-apt/${initiator}", + "puppet:///modules/site_apt/${fqdn}/${initiator}", + "puppet:///modules/site_apt/${initiator}", "puppet:///modules/apt/${initiator}", ], } diff --git a/manifests/init.pp b/manifests/init.pp index 960f18d..2ae691f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -90,23 +90,23 @@ class apt { } apt_conf { "02show_upgraded": - source => [ "puppet:///modules/site-apt/${fqdn}/02show_upgraded", - "puppet:///modules/site-apt/02show_upgraded", + source => [ "puppet:///modules/site_apt/${fqdn}/02show_upgraded", + "puppet:///modules/site_apt/02show_upgraded", "puppet:///modules/apt/02show_upgraded" ] } if ( $virtual == "vserver" ) { apt_conf { "03clean_vserver": - source => [ "puppet:///modules/site-apt/${fqdn}/03clean_vserver", - "puppet:///modules/site-apt/03clean_vserver", + source => [ "puppet:///modules/site_apt/${fqdn}/03clean_vserver", + "puppet:///modules/site_apt/03clean_vserver", "puppet:///modules/apt/03clean_vserver" ], alias => "03clean"; } } else { apt_conf { "03clean": - source => [ "puppet:///modules/site-apt/${fqdn}/03clean", - "puppet:///modules/site-apt/03clean", + source => [ "puppet:///modules/site_apt/${fqdn}/03clean", + "puppet:///modules/site_apt/03clean", "puppet:///modules/apt/03clean" ] } } diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 839f200..d831934 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -1,7 +1,7 @@ define apt::preseeded_package ($content = "", $ensure = "installed") { $seedfile = "/var/cache/local/preseeding/$name.seeds" $real_content = $content ? { - "" => template ( "site-apt/$lsbdistcodename/$name.seeds" ), + "" => template ( "site_apt/$lsbdistcodename/$name.seeds" ), default => $content } diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index f31a3fb..34d4d31 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -6,8 +6,8 @@ class apt::unattended_upgrades { } apt_conf { "50unattended-upgrades": - source => ["puppet:///modules/site-apt/$lsbdistcodename/50unattended-upgrades", - "puppet:///modules/site-apt/50unattended-upgrades", + source => ["puppet:///modules/site_apt/$lsbdistcodename/50unattended-upgrades", + "puppet:///modules/site_apt/50unattended-upgrades", "puppet:///modules/apt/$lsbdistcodename/50unattended-upgrades", "puppet:///modules/apt/50unattended-upgrades" ], require => Package['unattended-upgrades'], -- cgit v1.2.3 From 13a0b4484fc85be0821f0b72c11c9487c890b546 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 8 Jun 2012 18:18:50 +0200 Subject: Support multiple APT preferences snippets for the same package name pattern. This is implemented by adding a "package" parameter to apt::preferences_snippet, so that define names can be kept unique while the package names are not necessarily. Closes: Redmine#3468. --- README | 7 +++++++ manifests/preferences_snippet.pp | 1 + templates/preferences_snippet.erb | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'README') diff --git a/README b/README index bdb8185..82d216a 100644 --- a/README +++ b/README @@ -314,6 +314,13 @@ Example: priority => 999; } + apt::preferences_snippet{ + 'unstable_fallback': + package => '*', + release => 'unstable', + priority => 1; + } + apt::preseeded_package ---------------------- diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 91b3dde..908ca73 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -1,4 +1,5 @@ define apt::preferences_snippet( + $package = $name, $ensure = 'present', $source = '', $release, diff --git a/templates/preferences_snippet.erb b/templates/preferences_snippet.erb index 4dfb701..0c4e136 100644 --- a/templates/preferences_snippet.erb +++ b/templates/preferences_snippet.erb @@ -1,4 +1,4 @@ -Package: <%= name %> +Package: <%= package %> Pin: release a=<%= release %> Pin-Priority: <%= priority %> -- cgit v1.2.3 From 2e4d22ddd948b6d6f1532654e3dea53fa4b9f7d1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 8 Jun 2012 18:30:23 +0200 Subject: Allow passing arbitrary Pin value to apt::preferences_snippet. Closes: Redmine#3467. --- README | 6 ++++++ manifests/preferences_snippet.pp | 23 ++++++++++++++++++++--- templates/preferences_snippet.erb | 2 +- templates/preferences_snippet_release.erb | 4 ++++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 templates/preferences_snippet_release.erb (limited to 'README') diff --git a/README b/README index 82d216a..2e9d48f 100644 --- a/README +++ b/README @@ -321,6 +321,12 @@ Example: priority => 1; } + apt::preferences_snippet{ + 'ttdnsd': + pin => 'origin deb.torproject.org', + priority => 999; + } + apt::preseeded_package ---------------------- diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 908ca73..e00c4d1 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -2,7 +2,8 @@ define apt::preferences_snippet( $package = $name, $ensure = 'present', $source = '', - $release, + $release = '', + $pin = '', $priority ) { @@ -10,6 +11,13 @@ define apt::preferences_snippet( fail("Trying to define a preferences_snippet with \$custom_preferences set to false.") } + if !$pin and !$release { + fail("apt::preferences_snippet requires one of the 'pin' or 'release' argument to be set") + } + if $pin and $release { + fail("apt::preferences_snippet requires either a 'pin' or 'release' argument, not both") + } + include apt::preferences concat::fragment{"apt_preference_${name}": @@ -22,8 +30,17 @@ define apt::preferences_snippet( # lenny, we can't generalize without going into ugly special-casing. case $source { '': { - Concat::Fragment["apt_preference_${name}"]{ - content => template("apt/preferences_snippet.erb") + case $release { + '': { + Concat::Fragment["apt_preference_${name}"]{ + content => template("apt/preferences_snippet.erb") + } + } + default: { + Concat::Fragment["apt_preference_${name}"]{ + content => template("apt/preferences_snippet_release.erb") + } + } } } default: { diff --git a/templates/preferences_snippet.erb b/templates/preferences_snippet.erb index 0c4e136..fd15ce6 100644 --- a/templates/preferences_snippet.erb +++ b/templates/preferences_snippet.erb @@ -1,4 +1,4 @@ Package: <%= package %> -Pin: release a=<%= release %> +Pin: <%= pin %> Pin-Priority: <%= priority %> diff --git a/templates/preferences_snippet_release.erb b/templates/preferences_snippet_release.erb new file mode 100644 index 0000000..0c4e136 --- /dev/null +++ b/templates/preferences_snippet_release.erb @@ -0,0 +1,4 @@ +Package: <%= package %> +Pin: release a=<%= release %> +Pin-Priority: <%= priority %> + -- cgit v1.2.3 From 4f433dbd5238e6b5211d3b0f240ff58031c3da2b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 8 Aug 2012 11:25:02 -0400 Subject: update README to reflect the requirement of the lsb module --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README') diff --git a/README b/README index 2e9d48f..be80c62 100644 --- a/README +++ b/README @@ -17,7 +17,7 @@ Ubuntu support is lagging behind but not absent either. This module needs: -- lsb-release installed +- the lsb module: git://labs.riseup.net/shared-lsb - the common module: git://labs.riseup.net/shared-common - the concat module: git://labs.riseup.net/shared-concat -- cgit v1.2.3