From 87d2fe06d1b91c76cdc6ef59cf4d0c48db3da134 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 18:21:42 +0100 Subject: refactor to fit pbp - refactor every class and define into its very own file to fit better (at least our) puppet's best practices. - some cosmetic rearrangements - no code changes have been made, only reordering --- manifests/init.pp | 317 ++++++++++++++++++++---------------------------------- 1 file changed, 118 insertions(+), 199 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index f8d7e4a..d6a8fb7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,204 +5,123 @@ class apt { - # See README - $real_apt_clean = $apt_clean ? { - '' => 'auto', - default => $apt_clean, - } - - package { apt: ensure => installed } - - # a few templates need lsbdistcodename - include assert_lsbdistcodename - - case $custom_sources_list { - '': { - include default_sources_list - } - default: { - config_file { "/etc/apt/sources.list": - content => $custom_sources_list, - require => Exec[assert_lsbdistcodename]; - } - } - } - - class default_sources_list { - config_file { - # include main, security and backports - # additional sources could be included via an array - "/etc/apt/sources.list": - content => template("apt/sources.list.erb"), - require => Exec[assert_lsbdistcodename]; - } - } - - case $custom_preferences { - '': { - include default_preferences - } - default: { - config_file { "/etc/apt/preferences": - content => $custom_preferences, - alias => apt_config, - require => File["/etc/apt/sources.list"]; - } - } - } - class default_preferences { - config_file { - # this just pins unstable and testing to very low values - "/etc/apt/preferences": - content => template("apt/preferences.erb"), - # use File[apt_config] to reference a completed configuration - # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML - alias => apt_config, - # only update together - require => File["/etc/apt/sources.list"]; - # little default settings which keep the system sane - "/etc/apt/apt.conf.d/from_puppet": - content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n", - before => File[apt_config]; - } - } + # See README + $real_apt_clean = $apt_clean ? { + '' => 'auto', + default => $apt_clean, + } + + package { apt: ensure => installed } + + # a few templates need lsbdistcodename + include assert_lsbdistcodename + + case $custom_sources_list { + '': { + include apt::default_sources_list + } + default: { + config_file { "/etc/apt/sources.list": + content => $custom_sources_list, + require => Exec[assert_lsbdistcodename]; + } + } + } + + case $custom_preferences { + '': { + include apt::default_preferences + } + default: { + config_file { "/etc/apt/preferences": + content => $custom_preferences, + alias => apt_config, + require => File["/etc/apt/sources.list"]; + } + } + } $apt_base_dir = "${module_dir_path}/apt" - module_dir { apt: } - # watch apt.conf.d - file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; } - - exec { - # "&& sleep 1" is workaround for older(?) clients - "/usr/bin/apt-get update && sleep 1 #on refresh": - refreshonly => true, - subscribe => [ File["/etc/apt/sources.list"], - File["/etc/apt/preferences"], File["/etc/apt/apt.conf.d"], - File[apt_config] ]; - "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": - require => [ File["/etc/apt/sources.list"], - File["/etc/apt/preferences"], File[apt_config] ], - # Another Semaphor for all packages to reference - alias => apt_updated; - } - - ## This package should really always be current - package { "debian-archive-keyring": - ensure => latest, - } - - case $lsbdistcodename { - etch: { - package { "debian-backports-keyring": - ensure => latest, - } - - # This key was downloaded from - # http://backports.org/debian/archive.key - # and is needed to bootstrap the backports trustpath - file { "${apt_base_dir}/backports.org.key": - source => "puppet://$servername/apt/backports.org.key", - mode => 0444, owner => root, group => root, - } - exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": - alias => "backports_key", - refreshonly => true, - subscribe => File["${apt_base_dir}/backports.org.key"], - before => [ File[apt_config], Package["debian-backports-keyring"] ] - } - } - lenny: { - package { "debian-backports-keyring": - ensure => latest, - } - - # This key was downloaded from - # http://backports.org/debian/archive.key - # and is needed to bootstrap the backports trustpath - file { "${apt_base_dir}/backports.org.key": - source => "puppet://$servername/apt/backports.org.key", - mode => 0444, owner => root, group => root, - } - exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": - alias => "backports_key", - refreshonly => true, - subscribe => File["${apt_base_dir}/backports.org.key"], - before => [ File[apt_config], Package["debian-backports-keyring"] ] - } - } - } - - case $custom_key_dir { - '': { - exec { "/bin/true # no_custom_keydir": } - } - default: { - file { "${apt_base_dir}/keys.d": - source => "$custom_key_dir", - recurse => true, - mode => 0755, owner => root, group => root, - } - exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update": - alias => "custom_keys", - subscribe => File["${apt_base_dir}/keys.d"], - refreshonly => true, - before => File[apt_config]; - } - } - } - - # workaround for preseeded_package component - file { "/var/cache": ensure => directory } - file { "/var/cache/local": ensure => directory } - file { "/var/cache/local/preseeding/": ensure => directory } - - define preseeded_package ($content = "", $ensure = "installed") { - $seedfile = "/var/cache/local/preseeding/$name.seeds" - $real_content = $content ? { - "" => template ( "$debian_version/$name.seeds" ), - Default => $content - } - - file{ $seedfile: - content => $real_content, - mode => 0600, owner => root, group => root, - } - - package { $name: - ensure => $ensure, - responsefile => $seedfile, - require => File[$seedfile], - } - } - - define upgrade_package ($version = "") { - case $version { - '': { - exec { "aptitude -y install $name": - onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], - } - } - 'latest': { - exec { "aptitude -y install $name": - onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], - } - } - default: { - exec { "aptitude -y install $name=$version": - onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], - } - } - } - } -} - -class dselect { - # suppress annoying help texts of dselect - line { dselect_expert: - file => "/etc/dpkg/dselect.cfg", - line => "expert", - ensure => present, - } - - package { dselect: ensure => installed } -} + module_dir { apt: } + # watch apt.conf.d + file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; } + + exec { + # "&& sleep 1" is workaround for older(?) clients + "/usr/bin/apt-get update && sleep 1 #on refresh": + refreshonly => true, + subscribe => [ File["/etc/apt/sources.list"], + File["/etc/apt/preferences"], + File["/etc/apt/apt.conf.d"], + File[apt_config] ]; + "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": + require => [ File["/etc/apt/sources.list"], + File["/etc/apt/preferences"], File[apt_config] ], + # Another Semaphor for all packages to reference + alias => apt_updated; + } + + ## This package should really always be current + package { "debian-archive-keyring": ensure => latest } + + case $lsbdistcodename { + etch: { + package { "debian-backports-keyring": ensure => latest } + + # This key was downloaded from + # http://backports.org/debian/archive.key + # and is needed to bootstrap the backports trustpath + file { "${apt_base_dir}/backports.org.key": + source => "puppet://$servername/apt/backports.org.key", + mode => 0444, owner => root, group => root, + } + exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": + alias => "backports_key", + refreshonly => true, + subscribe => File["${apt_base_dir}/backports.org.key"], + before => [ File[apt_config], Package["debian-backports-keyring"] ] + } + } + lenny: { + package { "debian-backports-keyring": ensure => latest } + + # This key was downloaded from + # http://backports.org/debian/archive.key + # and is needed to bootstrap the backports trustpath + file { "${apt_base_dir}/backports.org.key": + source => "puppet://$servername/apt/backports.org.key", + mode => 0444, owner => root, group => root, + } + exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": + alias => "backports_key", + refreshonly => true, + subscribe => File["${apt_base_dir}/backports.org.key"], + before => [ File[apt_config], Package["debian-backports-keyring"] ] + } + } + } + + case $custom_key_dir { + '': { + exec { "/bin/true # no_custom_keydir": } + } + default: { + file { "${apt_base_dir}/keys.d": + source => "$custom_key_dir", + recurse => true, + mode => 0755, owner => root, group => root, + } + exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update": + alias => "custom_keys", + subscribe => File["${apt_base_dir}/keys.d"], + refreshonly => true, + before => File[apt_config]; + } + } + } + + # workaround for preseeded_package component + file { "/var/cache": ensure => directory } + file { "/var/cache/local": ensure => directory } + file { "/var/cache/local/preseeding/": ensure => directory } +} -- cgit v1.2.3 From b0e0f720d0f0480c96c377bde6f46a2d8820f646 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 20:20:42 +0100 Subject: add refactored files --- manifests/default_preferences.pp | 16 ++++++++++++++++ manifests/default_sources_list.pp | 10 ++++++++++ manifests/dselect.pp | 10 ++++++++++ manifests/preseeded_package.pp | 18 ++++++++++++++++++ manifests/upgrade_package.pp | 19 +++++++++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 manifests/default_preferences.pp create mode 100644 manifests/default_sources_list.pp create mode 100644 manifests/dselect.pp create mode 100644 manifests/preseeded_package.pp create mode 100644 manifests/upgrade_package.pp diff --git a/manifests/default_preferences.pp b/manifests/default_preferences.pp new file mode 100644 index 0000000..659474f --- /dev/null +++ b/manifests/default_preferences.pp @@ -0,0 +1,16 @@ +class apt::default_preferences { + config_file { + # this just pins unstable and testing to very low values + "/etc/apt/preferences": + content => template("apt/preferences.erb"), + # use File[apt_config] to reference a completed configuration + # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML + alias => apt_config, + # only update together + require => File["/etc/apt/sources.list"]; + # little default settings which keep the system sane + "/etc/apt/apt.conf.d/from_puppet": + content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n", + before => File[apt_config]; + } +} diff --git a/manifests/default_sources_list.pp b/manifests/default_sources_list.pp new file mode 100644 index 0000000..8c14b53 --- /dev/null +++ b/manifests/default_sources_list.pp @@ -0,0 +1,10 @@ +class apt::default_sources_list { + config_file { + # include main, security and backports + # additional sources could be included via an array + "/etc/apt/sources.list": + content => template("apt/sources.list.erb"), + require => Exec[assert_lsbdistcodename]; + } +} + diff --git a/manifests/dselect.pp b/manifests/dselect.pp new file mode 100644 index 0000000..fb138da --- /dev/null +++ b/manifests/dselect.pp @@ -0,0 +1,10 @@ +class apt::dselect { + # suppress annoying help texts of dselect + line { dselect_expert: + file => "/etc/dpkg/dselect.cfg", + line => "expert", + ensure => present, + } + + package { dselect: ensure => installed } +} diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp new file mode 100644 index 0000000..276c90f --- /dev/null +++ b/manifests/preseeded_package.pp @@ -0,0 +1,18 @@ +define apt::preseeded_package ($content = "", $ensure = "installed") { + $seedfile = "/var/cache/local/preseeding/$name.seeds" + $real_content = $content ? { + "" => template ( "$debian_version/$name.seeds" ), + Default => $content + } + + file{ $seedfile: + content => $real_content, + mode => 0600, owner => root, group => root, + } + + package { $name: + ensure => $ensure, + responsefile => $seedfile, + require => File[$seedfile], + } +} diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp new file mode 100644 index 0000000..41d5d52 --- /dev/null +++ b/manifests/upgrade_package.pp @@ -0,0 +1,19 @@ +define apt::upgrade_package ($version = "") { + case $version { + '': { + exec { "aptitude -y install $name": + onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], + } + } + 'latest': { + exec { "aptitude -y install $name": + onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], + } + } + default: { + exec { "aptitude -y install $name=$version": + onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], + } + } + } +} -- cgit v1.2.3 From 84f7ca76419eecc83cb2bddb048b2e3fb6e36386 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 20:35:30 +0100 Subject: introduce a class to manage unattended-upgrades --- README | 8 +++++++- manifests/init.pp | 4 ++++ manifests/unattended_upgrades.pp | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 manifests/unattended_upgrades.pp diff --git a/README b/README index c6e6c4e..e624bba 100644 --- a/README +++ b/README @@ -34,7 +34,6 @@ From apt.conf(5), 0.7.2: instance). pre-auto performs this action before downloading new packages." - $lsbdistcodename ---------------- Contains the codename ("etch", "lenny", ...) of the client's @@ -69,6 +68,13 @@ apt keyring, you can set this variable to a path in your fileserver where individual key files can be placed. If this is set and keys exist there, this module will apt-key add each key +$apt_unattended_upgrades +------------------------ + +If this variable is set to true apt::unattended_upgrades is included, +which will install the package unattended-upgrades and configure it to +daily upgrade the system. + Classes ======= diff --git a/manifests/init.pp b/manifests/init.pp index d6a8fb7..5dc0d75 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -41,6 +41,10 @@ class apt { } } + if $apt_unattended_upgrades { + include apt::unattended_upgrades + } + $apt_base_dir = "${module_dir_path}/apt" module_dir { apt: } # watch apt.conf.d diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp new file mode 100644 index 0000000..f4544fa --- /dev/null +++ b/manifests/unattended_upgrades.pp @@ -0,0 +1,12 @@ +class apt::unattended_upgrades { + package{'unattended-upgrades': } + config_file { + "/etc/apt/apt.conf.d/unattended_upgrades": + content => "APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Unattended-Upgrade "1"; +", + before => File[apt_config], + require => Package['unattended-upgrades'], + } + } +} -- cgit v1.2.3 From 1874479b3b23c4a63b6544754448da0d594fb468 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 20:51:31 +0100 Subject: fixing a string issue and tell it to install the package --- manifests/unattended_upgrades.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index f4544fa..0ebccae 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -1,10 +1,11 @@ class apt::unattended_upgrades { - package{'unattended-upgrades': } + package{'unattended-upgrades': ensure => present } + config_file { "/etc/apt/apt.conf.d/unattended_upgrades": - content => "APT::Periodic::Update-Package-Lists "1"; + content => 'APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1"; -", +', before => File[apt_config], require => Package['unattended-upgrades'], } -- cgit v1.2.3 From 0daa30f43504d9660eddc24875826cc583166d84 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 21:15:21 +0100 Subject: fix another typo --- manifests/unattended_upgrades.pp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 0ebccae..cfadc5e 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -2,12 +2,11 @@ class apt::unattended_upgrades { package{'unattended-upgrades': ensure => present } config_file { - "/etc/apt/apt.conf.d/unattended_upgrades": - content => 'APT::Periodic::Update-Package-Lists "1"; + "/etc/apt/apt.conf.d/unattended_upgrades": + content => 'APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1"; ', - before => File[apt_config], - require => Package['unattended-upgrades'], - } + before => File[apt_config], + require => Package['unattended-upgrades'], } } -- cgit v1.2.3 From 61142025e7cf0a12473fce9b31c887cfc90f429d Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 21:43:43 +0100 Subject: our module_dir is currently called modules_dir --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 5dc0d75..c2dd547 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -46,7 +46,7 @@ class apt { } $apt_base_dir = "${module_dir_path}/apt" - module_dir { apt: } + modules_dir { apt: } # watch apt.conf.d file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; } -- cgit v1.2.3 From 17be8ac18445cd2dd0db693aead10e5afc74fe19 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 22:04:48 +0100 Subject: switch to new lsb way --- manifests/default_sources_list.pp | 3 ++- manifests/init.pp | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/manifests/default_sources_list.pp b/manifests/default_sources_list.pp index 8c14b53..7db6535 100644 --- a/manifests/default_sources_list.pp +++ b/manifests/default_sources_list.pp @@ -1,10 +1,11 @@ class apt::default_sources_list { + include lsb config_file { # include main, security and backports # additional sources could be included via an array "/etc/apt/sources.list": content => template("apt/sources.list.erb"), - require => Exec[assert_lsbdistcodename]; + require => Package['lsb']; } } diff --git a/manifests/init.pp b/manifests/init.pp index c2dd547..eaf6bb8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,17 +13,15 @@ class apt { package { apt: ensure => installed } - # a few templates need lsbdistcodename - include assert_lsbdistcodename - case $custom_sources_list { '': { include apt::default_sources_list } default: { + include lsb config_file { "/etc/apt/sources.list": content => $custom_sources_list, - require => Exec[assert_lsbdistcodename]; + require => Exec['lsb']; } } } -- cgit v1.2.3 From 848dff40a3b77ad5fe19d6e634bdfd0fa93d5cb4 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 22:19:07 +0100 Subject: fixing requirements --- manifests/init.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index eaf6bb8..1d0bc38 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,7 +11,10 @@ class apt { default => $apt_clean, } - package { apt: ensure => installed } + package { apt: + ensure => installed, + require => undef, + } case $custom_sources_list { '': { @@ -21,7 +24,7 @@ class apt { include lsb config_file { "/etc/apt/sources.list": content => $custom_sources_list, - require => Exec['lsb']; + require => Package['lsb']; } } } -- cgit v1.2.3 From 211ea52187a15da556545b055dcf04f2bd759bb2 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 23:07:12 +0100 Subject: don't require anything --- manifests/unattended_upgrades.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index cfadc5e..19b8308 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -1,5 +1,8 @@ class apt::unattended_upgrades { - package{'unattended-upgrades': ensure => present } + package{'unattended-upgrades': + ensure => present + require => undef, + } config_file { "/etc/apt/apt.conf.d/unattended_upgrades": -- cgit v1.2.3 From ae4c5a63745d2fcfd628b1876387496c5913e26d Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 23:15:46 +0100 Subject: fix typo --- manifests/unattended_upgrades.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 19b8308..aabf51d 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -1,6 +1,6 @@ class apt::unattended_upgrades { package{'unattended-upgrades': - ensure => present + ensure => present, require => undef, } -- cgit v1.2.3 From 64d2c07735c6be3fbe86322864956f549a19da20 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 2 Nov 2009 01:12:12 +0100 Subject: change pending module file resources to new 0.25 style --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1d0bc38..4746a3d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -77,7 +77,7 @@ class apt { # http://backports.org/debian/archive.key # and is needed to bootstrap the backports trustpath file { "${apt_base_dir}/backports.org.key": - source => "puppet://$servername/apt/backports.org.key", + source => "puppet://$server/modules/apt/backports.org.key", mode => 0444, owner => root, group => root, } exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": @@ -94,7 +94,7 @@ class apt { # http://backports.org/debian/archive.key # and is needed to bootstrap the backports trustpath file { "${apt_base_dir}/backports.org.key": - source => "puppet://$servername/apt/backports.org.key", + source => "puppet://$server/modules/apt/backports.org.key", mode => 0444, owner => root, group => root, } exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": -- cgit v1.2.3 From f315dedce66caaf48341b9c7e56fa485a752c784 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Nov 2009 14:35:09 +0100 Subject: fix preseeding dir path --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4746a3d..f87bf90 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -128,5 +128,5 @@ class apt { # workaround for preseeded_package component file { "/var/cache": ensure => directory } file { "/var/cache/local": ensure => directory } - file { "/var/cache/local/preseeding/": ensure => directory } + file { "/var/cache/local/preseeding": ensure => directory } } -- cgit v1.2.3 From a41c9ef86bb3f866d08a1b25f65cff646d525fa4 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 9 May 2010 22:44:40 +0200 Subject: adjust new module dir path --- manifests/init.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index f87bf90..701005b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -46,7 +46,8 @@ class apt { include apt::unattended_upgrades } - $apt_base_dir = "${module_dir_path}/apt" + include common::moduledir + $apt_base_dir = "${common::moduledir::module_dir_path}/apt" modules_dir { apt: } # watch apt.conf.d file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; } -- cgit v1.2.3 From bcb3ff88cddc6e531b4c03c754c312e7591f93fc Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 28 Jun 2010 21:49:09 +0200 Subject: set loglevel to info so we don't pollute the logs --- manifests/init.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/init.pp b/manifests/init.pp index 701005b..c06c2ef 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -63,6 +63,7 @@ class apt { "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": require => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], File[apt_config] ], + loglevel => info, # Another Semaphor for all packages to reference alias => apt_updated; } -- cgit v1.2.3 From 6aee66b509319c0b42535a89dd64ad846f015c40 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 7 Aug 2010 02:12:12 +0200 Subject: remove unnecessary fileserver variable (#2460) --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c06c2ef..5ec798e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -79,7 +79,7 @@ class apt { # http://backports.org/debian/archive.key # and is needed to bootstrap the backports trustpath file { "${apt_base_dir}/backports.org.key": - source => "puppet://$server/modules/apt/backports.org.key", + source => "puppet:///modules/apt/backports.org.key", mode => 0444, owner => root, group => root, } exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": @@ -96,7 +96,7 @@ class apt { # http://backports.org/debian/archive.key # and is needed to bootstrap the backports trustpath file { "${apt_base_dir}/backports.org.key": - source => "puppet://$server/modules/apt/backports.org.key", + source => "puppet:///modules/apt/backports.org.key", mode => 0444, owner => root, group => root, } exec { "/usr/bin/apt-key add ${apt_base_dir}/backports.org.key && apt-get update": -- cgit v1.2.3 From d1f120fd2d0f2285b862acca77f2367aaaf2f1bc Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 9 Aug 2010 14:30:34 +0200 Subject: fix relation --- manifests/default_preferences.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/default_preferences.pp b/manifests/default_preferences.pp index 659474f..3cdb355 100644 --- a/manifests/default_preferences.pp +++ b/manifests/default_preferences.pp @@ -11,6 +11,6 @@ class apt::default_preferences { # little default settings which keep the system sane "/etc/apt/apt.conf.d/from_puppet": content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n", - before => File[apt_config]; + before => Config_file[apt_config]; } } -- cgit v1.2.3 From 604cef0cc93725118d34f16e9133d0cc81b12c79 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 9 Aug 2010 14:37:54 +0200 Subject: fix relation --- manifests/init.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 5ec798e..d1f5cfe 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -59,10 +59,10 @@ class apt { subscribe => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], File["/etc/apt/apt.conf.d"], - File[apt_config] ]; + Config_file[apt_config] ]; "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": require => [ File["/etc/apt/sources.list"], - File["/etc/apt/preferences"], File[apt_config] ], + File["/etc/apt/preferences"], Config_file[apt_config] ], loglevel => info, # Another Semaphor for all packages to reference alias => apt_updated; @@ -103,7 +103,7 @@ class apt { alias => "backports_key", refreshonly => true, subscribe => File["${apt_base_dir}/backports.org.key"], - before => [ File[apt_config], Package["debian-backports-keyring"] ] + before => [ Config_file[apt_config], Package["debian-backports-keyring"] ] } } } @@ -122,7 +122,7 @@ class apt { alias => "custom_keys", subscribe => File["${apt_base_dir}/keys.d"], refreshonly => true, - before => File[apt_config]; + before => Config_file[apt_config]; } } } -- cgit v1.2.3 From 33f1b53c892c6a477014af211afe913888879398 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 10 Aug 2010 16:27:54 +0200 Subject: improve exec naming --- manifests/init.pp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index d1f5cfe..af860f7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -54,13 +54,15 @@ class apt { exec { # "&& sleep 1" is workaround for older(?) clients - "/usr/bin/apt-get update && sleep 1 #on refresh": + 'refresh_apt': + command => '/usr/bin/apt-get update && sleep 1', refreshonly => true, subscribe => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], File["/etc/apt/apt.conf.d"], Config_file[apt_config] ]; - "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": + 'update_apt': + command => '/usr/bin/apt-get update && /usr/bin/apt-get autoclean', require => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], Config_file[apt_config] ], loglevel => info, -- cgit v1.2.3 From dd36612e50b2c44135fa10fdc3d6120ff2b1220e Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Aug 2010 13:56:31 +0200 Subject: refer to correct resource --- manifests/unattended_upgrades.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index aabf51d..c984c40 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -9,7 +9,7 @@ class apt::unattended_upgrades { content => 'APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Unattended-Upgrade "1"; ', - before => File[apt_config], + before => Config_file[apt_config], require => Package['unattended-upgrades'], } } -- cgit v1.2.3