From 1e2cac92bbb667ab7e84e121f125f38976f34d3a Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 1 Feb 2016 11:54:33 +0100 Subject: [refactor] Don't declare dependencies for apt resources The apt module now takes care of all the dependencies removed from `site_apt`. Also, the dependency to install the `lsb` package after `refresh_apt` is unnesseccary because lsb facts won't work anyway on the first run if `lsb` is not installed before, so we can safely remove it. --- puppet/modules/site_apt/manifests/init.pp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'puppet/modules/site_apt/manifests') diff --git a/puppet/modules/site_apt/manifests/init.pp b/puppet/modules/site_apt/manifests/init.pp index c809a837..fea4b8e7 100644 --- a/puppet/modules/site_apt/manifests/init.pp +++ b/puppet/modules/site_apt/manifests/init.pp @@ -52,13 +52,10 @@ class site_apt { pin => 'origin "deb.leap.se"' } - # All packages should be installed _after_ refresh_apt is called, - # which does an apt-get update. - # There is one exception: - # The creation of sources.list depends on the lsb package +# All packages should be installed _after_ refresh_apt is called, +# which does an apt-get update. + + Exec['refresh_apt'] -> + Package <||> - File['/etc/apt/preferences'] -> - Apt::Preferences_snippet <| |> -> - Exec['refresh_apt'] -> - Package <| ( title != 'lsb' ) |> } -- cgit v1.2.3 From 8f1c23dfb5a08240235301bbc07e1bbe82569b7b Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 1 Feb 2016 13:24:53 +0100 Subject: [refactor] Remove atomic apt package dependecy `site_config::default.pp` takes care the all packages are installed before `Exec['refresh_apt']`, so we don't need to add it here for a single package. --- puppet/modules/site_apt/manifests/leap_repo.pp | 3 --- 1 file changed, 3 deletions(-) (limited to 'puppet/modules/site_apt/manifests') diff --git a/puppet/modules/site_apt/manifests/leap_repo.pp b/puppet/modules/site_apt/manifests/leap_repo.pp index a1382374..60948d91 100644 --- a/puppet/modules/site_apt/manifests/leap_repo.pp +++ b/puppet/modules/site_apt/manifests/leap_repo.pp @@ -13,7 +13,4 @@ class site_apt::leap_repo { ensure => latest } - # We wont be able to install the leap-keyring package unless the leap apt - # source has been added and apt has been refreshed - Exec['refresh_apt'] -> Package['leap-keyring'] } -- cgit v1.2.3 From 432b139f6529fab2f190b7f066064559ecd5a5d5 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 1 Feb 2016 16:53:10 +0100 Subject: [refactor] Use Exec[apt_updated] instead of Exec[refresh_apt] Because this is the recommended way of depnending in the apt README. --- puppet/modules/site_apt/manifests/dist_upgrade.pp | 2 +- puppet/modules/site_apt/manifests/init.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'puppet/modules/site_apt/manifests') diff --git a/puppet/modules/site_apt/manifests/dist_upgrade.pp b/puppet/modules/site_apt/manifests/dist_upgrade.pp index 40e2dd58..0eb98cea 100644 --- a/puppet/modules/site_apt/manifests/dist_upgrade.pp +++ b/puppet/modules/site_apt/manifests/dist_upgrade.pp @@ -11,7 +11,7 @@ class site_apt::dist_upgrade { command => "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade", refreshonly => false, timeout => 1200, - require => Exec['refresh_apt'] + require => Exec['apt_updated'] } } } diff --git a/puppet/modules/site_apt/manifests/init.pp b/puppet/modules/site_apt/manifests/init.pp index fea4b8e7..04b1ce69 100644 --- a/puppet/modules/site_apt/manifests/init.pp +++ b/puppet/modules/site_apt/manifests/init.pp @@ -55,7 +55,7 @@ class site_apt { # All packages should be installed _after_ refresh_apt is called, # which does an apt-get update. - Exec['refresh_apt'] -> + Exec['apt_updated'] -> Package <||> } -- cgit v1.2.3 From 9278d76636fcffa624528b1fb11a7197f9f6b27c Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 1 Feb 2016 17:35:16 +0100 Subject: [refactor] Dont duplicate Package resource override `site_apt` aready ensures for installing packages after Exec[update_apt] is run, so we don't need to duplicate this in `site_config::default.pp`. --- puppet/modules/site_apt/manifests/init.pp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'puppet/modules/site_apt/manifests') diff --git a/puppet/modules/site_apt/manifests/init.pp b/puppet/modules/site_apt/manifests/init.pp index 04b1ce69..447e1781 100644 --- a/puppet/modules/site_apt/manifests/init.pp +++ b/puppet/modules/site_apt/manifests/init.pp @@ -52,10 +52,8 @@ class site_apt { pin => 'origin "deb.leap.se"' } -# All packages should be installed _after_ refresh_apt is called, -# which does an apt-get update. - - Exec['apt_updated'] -> - Package <||> + # All packages should be installed after 'update_apt' is called, + # which does an 'apt-get update'. + Exec['update_apt'] -> Package <||> } -- cgit v1.2.3