From 4bd4dd254263003a404a1573abd50307b04057c8 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 8 Jan 2014 21:27:05 +0100 Subject: [PATCH 1/6] use stdlib instead of the common module --- manifests/dselect.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/dselect.pp b/manifests/dselect.pp index 6feeb9f..2b99a43 100644 --- a/manifests/dselect.pp +++ b/manifests/dselect.pp @@ -1,9 +1,10 @@ +# manage dselect, like +# suppressing the annoying help texts class apt::dselect { - # suppress annoying help texts of dselect - line { 'dselect_expert': - file => '/etc/dpkg/dselect.cfg', - line => 'expert', + file_line { 'dselect_expert': + path => '/etc/dpkg/dselect.cfg', + line => 'expert', } package { 'dselect': ensure => installed } From 9d56396a0439a19dd6cd3a09a5d1a9f7d6345778 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 8 Jan 2014 21:28:42 +0100 Subject: [PATCH 2/6] use the new style common module --- manifests/init.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7550aaa..034d79e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -111,9 +111,8 @@ class apt( # backports uses the normal archive key now package { 'debian-backports-keyring': ensure => absent } - include common::moduledir + common::module_dir { 'apt': } $apt_base_dir = "${common::moduledir::module_dir_path}/apt" - modules_dir { 'apt': } if $custom_key_dir { file { "${apt_base_dir}/keys.d": From af616677e6558d1ad2bfdcdf02dc318bec192363 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2014 10:59:26 +0200 Subject: [PATCH 3/6] address puppet 3.x deprecation warnings --- templates/20proxy.erb | 2 +- templates/Debian/apticron_lenny.erb | 18 ++++---- templates/Debian/apticron_squeeze.erb | 18 ++++---- templates/Debian/apticron_wheezy.erb | 18 ++++---- templates/Debian/sources.list.erb | 56 +++++++++++------------ templates/preferences_snippet.erb | 6 +-- templates/preferences_snippet_release.erb | 6 +-- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/templates/20proxy.erb b/templates/20proxy.erb index ea706b6..520e7b1 100644 --- a/templates/20proxy.erb +++ b/templates/20proxy.erb @@ -1,5 +1,5 @@ // This file is managed by Puppet // all local modifications will be overwritten -Acquire::http { Proxy "<%= proxy %>:<%= port %>"; }; +Acquire::http { Proxy "<%= @proxy %>:<%= @port %>"; }; Acquire::HTTP::Proxy::bugs.debian.org "DIRECT"; diff --git a/templates/Debian/apticron_lenny.erb b/templates/Debian/apticron_lenny.erb index aad9985..86b0997 100644 --- a/templates/Debian/apticron_lenny.erb +++ b/templates/Debian/apticron_lenny.erb @@ -24,9 +24,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # of "hostname -f" for the system name in the mails it generates # # SYSTEM="foobar.example.com" -<%- unless scope.lookupvar('apt::apticron::system').to_s == "false" -%> -<%= "SYSTEM=\"#{scope.lookupvar('apt::apticron::system')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::system')).to_s == "false" -%> +SYSTEM="<%= v %>" +<% end -%> # # Set IPADDRESSNUM if you would like to configure the maximal number of IP @@ -34,9 +34,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # family type (inet, inet6), if available. # # IPADDRESSNUM="1" -<%- unless scope.lookupvar('apt::apticron::ipaddressnum').to_s == "false" -%> -<%= "IPADDRESSNUM=\"#{scope.lookupvar('apt::apticron::ipaddressnum')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::ipaddressnum')).to_s == "false" -%> +IPADDRESSNUM="<%= v %>" +<% end -%> # # Set IPADDRESSES to a whitespace seperated list of reachable addresses for @@ -44,7 +44,7 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # "ip" command # # IPADDRESSES="192.0.2.1 2001:db8:1:2:3::1" -<%- unless scope.lookupvar('apt::apticron::ipaddresses').to_s == "false" -%> -<%= "IPADDRESSES=\"#{scope.lookupvar('apt::apticron::ipaddresses')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::ipaddresses')).to_s == "false" -%> +IPADDRESSES="<%= v %>" +<% end -%> diff --git a/templates/Debian/apticron_squeeze.erb b/templates/Debian/apticron_squeeze.erb index 580179e..05b7c9b 100644 --- a/templates/Debian/apticron_squeeze.erb +++ b/templates/Debian/apticron_squeeze.erb @@ -26,9 +26,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # of "hostname -f" for the system name in the mails it generates # # SYSTEM="foobar.example.com" -<%- unless scope.lookupvar('apt::apticron::system').to_s == "false" -%> -<%= "SYSTEM=\"#{scope.lookupvar('apt::apticron::system')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::system')).to_s == "false" -%> +SYSTEM="<%= v %>" +<% end -%> # @@ -37,9 +37,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # family type (inet, inet6), if available. # # IPADDRESSNUM="1" -<%- unless scope.lookupvar('apt::apticron::ipaddressnum').to_s == "false" -%> -<%= "IPADDRESSNUM=\"#{scope.lookupvar('apt::apticron::ipaddressnum')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::ipaddressnum')).to_s == "false" -%> +IPADDRESSNUM="<%= v %>" +<% end -%> # @@ -48,9 +48,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # "ip" command # # IPADDRESSES="192.0.2.1 2001:db8:1:2:3::1" -<%- unless scope.lookupvar('apt::apticron::ipaddresses').to_s == "false" -%> -<%= "IPADDRESSES=\"#{scope.lookupvar('apt::apticron::ipaddresses')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::ipaddresses')).to_s == "false" -%> +IPADDRESSES="<%= v %>" +<% end -%> # diff --git a/templates/Debian/apticron_wheezy.erb b/templates/Debian/apticron_wheezy.erb index d8c8804..655854e 100644 --- a/templates/Debian/apticron_wheezy.erb +++ b/templates/Debian/apticron_wheezy.erb @@ -25,9 +25,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # of "hostname -f" for the system name in the mails it generates # # SYSTEM="foobar.example.com" -<%- unless scope.lookupvar('apt::apticron::system').to_s == "false" -%> -<%= "SYSTEM=\"#{scope.lookupvar('apt::apticron::system')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::system')).to_s == "false" -%> +SYSTEM="<%= v %>" +<% end -%> # # Set IPADDRESSNUM if you would like to configure the maximal number of IP @@ -35,9 +35,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # family type (inet, inet6), if available. # # IPADDRESSNUM="1" -<%- unless scope.lookupvar('apt::apticron::ipaddressnum').to_s == "false" -%> -<%= "IPADDRESSNUM=\"#{scope.lookupvar('apt::apticron::ipaddressnum')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::ipaddressnum')).to_s == "false" -%> +IPADDRESSNUM="<%= v %>" +<% end -%> # # Set IPADDRESSES to a whitespace separated list of reachable addresses for @@ -45,9 +45,9 @@ LISTCHANGES_PROFILE="<%= scope.lookupvar('apt::apticron::listchanges_profile') % # "ip" command # # IPADDRESSES="192.0.2.1 2001:db8:1:2:3::1" -<%- unless scope.lookupvar('apt::apticron::ipaddresses').to_s == "false" -%> -<%= "IPADDRESSES=\"#{scope.lookupvar('apt::apticron::ipaddresses')}\"" %> -<%- end -%> +<% unless (v=scope.lookupvar('apt::apticron::ipaddresses')).to_s == "false" -%> +IPADDRESSES=<%= v %>" +<% end -%> # # Set NOTIFY_HOLDS="0" if you don't want to be notified about new versions of diff --git a/templates/Debian/sources.list.erb b/templates/Debian/sources.list.erb index 65b5945..dee6ce5 100644 --- a/templates/Debian/sources.list.erb +++ b/templates/Debian/sources.list.erb @@ -5,7 +5,7 @@ # basic deb <%= debian_url=scope.lookupvar('apt::debian_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::real_repos') %> -<% if scope.lookupvar('apt::include_src') -%> +<% if include_src=scope.lookupvar('apt::include_src') -%> deb-src <%= debian_url %> <%= codename %> <%= lrepos %> <% end -%> @@ -14,61 +14,61 @@ deb-src <%= debian_url %> <%= codename %> <%= lrepos %> # There is no security support for <%= release %> <% else -%> deb <%= security_url=scope.lookupvar('apt::security_url') %> <%= codename %>/updates <%= lrepos %> -<% if include_src -%> +<% if include_src -%> deb-src <%= security_url %> <%= codename %>/updates <%= lrepos %> -<% end -%> -<% end -%> +<% end + end -%> # backports <% if (release == "testing" || release == "unstable" || release == "experimental") -%> # There is no backports archive for <%= release %> <% else -%> deb <%= backports_url=scope.lookupvar('apt::backports_url') %> <%= codename %>-backports <%= lrepos %> -<% if include_src -%> +<% if include_src -%> deb-src <%= backports_url %> <%= codename %>-backports <%= lrepos %> -<% end -%> -<% end -%> +<% end + end -%> <% if use_volatile=scope.lookupvar('apt::use_volatile') -%> # volatile -<% if (release == "testing" || release == "unstable" || release == "experimental") -%> +<% if (release == "testing" || release == "unstable" || release == "experimental") -%> # There is no volatile archive for <%= release %> -<% else -%> +<% else -%> deb <%= debian_url %> <%= codename %>-updates <%= lrepos %> -<% if include_src -%> +<% if include_src -%> deb-src <%= debian_url %> <%= codename %>-updates <%= lrepos %> -<% end -%> -<% end -%> -<% end -%> +<% end + end + end -%> <% if next_release=scope.lookupvar('apt::use_next_release') -%> ### Debian next: <%= next_release=scope.lookupvar('apt::next_release') ; next_codename=scope.lookupvar('apt::next_codename') %> # basic deb <%= debian_url %> <%= next_codename %> <%= lrepos %> -<% if include_src then -%> +<% if include_src -%> deb-src <%= debian_url %> <%= next_codename %> <%= lrepos %> -<% end -%> +<% end -%> # security -<% if (next_release == "unstable" || next_release == "experimental") -%> +<% if (next_release == "unstable" || next_release == "experimental") -%> # There is no security support for <%= next_release %> -<% else -%> +<% else -%> deb <%= security_url %> <%= next_codename %>/updates <%= lrepos %> -<% if include_src then -%> +<% if include_src then -%> deb-src <%= security_url %> <%= next_codename %>/updates <%= lrepos %> -<% end -%> -<% end -%> +<% end + end -%> -<% if use_volatile -%> +<% if use_volatile -%> # volatile -<% if (next_release == "testing" || next_release == "unstable" || next_release == "experimental") -%> +<% if (next_release == "testing" || next_release == "unstable" || next_release == "experimental") -%> # There is no volatile archive for <%= next_release %> -<% else -%> +<% else -%> deb <%= debian_url %> <%= next_codename %>-updates <%= lrepos %> -<% if include_src then -%> +<% if include_src -%> deb-src <%= debian_url %> <%= next_codename %>-updates <%= lrepos %> -<% end -%> -<% end -%> -<% end -%> -<% end -%> +<% end + end + end + end -%> diff --git a/templates/preferences_snippet.erb b/templates/preferences_snippet.erb index b7acaab..903e73d 100644 --- a/templates/preferences_snippet.erb +++ b/templates/preferences_snippet.erb @@ -1,4 +1,4 @@ -Package: <%= real_package %> -Pin: <%= pin %> -Pin-Priority: <%= priority %> +Package: <%= @real_package %> +Pin: <%= @pin %> +Pin-Priority: <%= @priority %> diff --git a/templates/preferences_snippet_release.erb b/templates/preferences_snippet_release.erb index 845d23f..b95d3f8 100644 --- a/templates/preferences_snippet_release.erb +++ b/templates/preferences_snippet_release.erb @@ -1,4 +1,4 @@ -Package: <%= real_package %> -Pin: release a=<%= release %> -Pin-Priority: <%= priority %> +Package: <%= @real_package %> +Pin: release a=<%= @release %> +Pin-Priority: <%= @priority %> From 0a1eee280f8fad6cdcdde806ffb1d172877da505 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Wed, 29 Oct 2014 18:14:36 -0400 Subject: [PATCH 4/6] Fix default 50unattended-upgrades because of Debian bug #704087 --- files/Debian/50unattended-upgrades | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/files/Debian/50unattended-upgrades b/files/Debian/50unattended-upgrades index 88f4ab8..78c7187 100644 --- a/files/Debian/50unattended-upgrades +++ b/files/Debian/50unattended-upgrades @@ -1,10 +1,7 @@ // this file is managed by puppet ! Unattended-Upgrade::Origins-Pattern { -// "o=Debian,n=${distro-codename}"; -// "o=Debian,n=${distro-codename}-updates"; -// "o=Debian,n=${distro_codename}-proposed-updates"; - "o=Debian,n=${distro_codename},l=Debian-Security"; + "o=Debian,a=stable,l=Debian-Security"; } APT::Periodic::Update-Package-Lists "1"; From fb9e13eebf00af2cd6a92eb600a1dd85d3eec5b2 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Wed, 29 Oct 2014 18:40:16 -0400 Subject: [PATCH 5/6] Add oldstable to default 50unattended-upgrades --- files/Debian/50unattended-upgrades | 1 + 1 file changed, 1 insertion(+) diff --git a/files/Debian/50unattended-upgrades b/files/Debian/50unattended-upgrades index 78c7187..075f680 100644 --- a/files/Debian/50unattended-upgrades +++ b/files/Debian/50unattended-upgrades @@ -1,6 +1,7 @@ // this file is managed by puppet ! Unattended-Upgrade::Origins-Pattern { + "o=Debian,a=oldstable,l=Debian-Security"; "o=Debian,a=stable,l=Debian-Security"; } From c9ae59e1b72d41518160ff4c7b430573b10254a3 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 31 Oct 2014 14:09:59 -0400 Subject: [PATCH 6/6] Fixes placeholders in 50unattended-upgrades.squeeze --- files/Debian/50unattended-upgrades.squeeze | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/Debian/50unattended-upgrades.squeeze b/files/Debian/50unattended-upgrades.squeeze index e7ba290..77f715d 100644 --- a/files/Debian/50unattended-upgrades.squeeze +++ b/files/Debian/50unattended-upgrades.squeeze @@ -3,8 +3,8 @@ Unattended-Upgrade::Allowed-Origins { // "${distro-id} oldstable"; // "${distro_id} ${distro_codename}-backports"; - "${distro-id} ${distro-codename}-security"; - "${distro-id} ${distro-codename}-lts"; + "${distro_id} ${distro_codename}-security"; + "${distro_id} ${distro_codename}-lts"; }; APT::Periodic::Update-Package-Lists "1";