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_config/manifests/setup.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'puppet/modules/site_config') diff --git a/puppet/modules/site_config/manifests/setup.pp b/puppet/modules/site_config/manifests/setup.pp index dba5fa14..82dfe76d 100644 --- a/puppet/modules/site_config/manifests/setup.pp +++ b/puppet/modules/site_config/manifests/setup.pp @@ -24,8 +24,7 @@ class site_config::setup { include site_apt package { 'facter': - ensure => latest, - require => Exec['refresh_apt'] + ensure => latest } # if squid_deb_proxy_client is set to true, install and configure -- cgit v1.2.3 From 4e2e0737efe244fb3d13c82d441a6804c1e9918d Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 1 Feb 2016 13:54:18 +0100 Subject: [bug] Fix duplicate definition error for Class[Apt] We need to include class `site_config::default` in class `site_config::slow` so we don't get this duplicate definition: - [local1.bitmask.local] Error: Duplicate declaration: Class[Apt] is already declared; cannot redeclare at /srv/leap/puppet/modules/site_apt/manifests/init.pp:29 on node local1.bitmask.local To be honest, i didn't figuered out the real cause of this, but it works with this. --- puppet/modules/site_config/manifests/slow.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'puppet/modules/site_config') diff --git a/puppet/modules/site_config/manifests/slow.pp b/puppet/modules/site_config/manifests/slow.pp index de276bc3..8e9b7035 100644 --- a/puppet/modules/site_config/manifests/slow.pp +++ b/puppet/modules/site_config/manifests/slow.pp @@ -4,6 +4,7 @@ class site_config::slow { tag 'leap_slow' + include site_config::default include apt::update class { 'site_apt::dist_upgrade': } } -- 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_config/manifests/default.pp | 2 +- puppet/modules/site_config/manifests/remove/jessie.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'puppet/modules/site_config') diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp index 96f06e6c..b5d0f32d 100644 --- a/puppet/modules/site_config/manifests/default.pp +++ b/puppet/modules/site_config/manifests/default.pp @@ -16,7 +16,7 @@ class site_config::default { # 'apt-get update' is executed by 'site_config::slow', it should be done # before any packages are installed. - Package { require => Exec['refresh_apt'] } + Package { require => Exec['apt_updated'] } # default class, used by all hosts diff --git a/puppet/modules/site_config/manifests/remove/jessie.pp b/puppet/modules/site_config/manifests/remove/jessie.pp index cbeaae05..c813e46d 100644 --- a/puppet/modules/site_config/manifests/remove/jessie.pp +++ b/puppet/modules/site_config/manifests/remove/jessie.pp @@ -3,7 +3,7 @@ class site_config::remove::jessie { tidy { '/etc/apt/preferences.d/rsyslog_anon_depends': - notify => Exec['refresh_apt']; + notify => Exec['apt_updated']; } } -- 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_config/manifests/default.pp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'puppet/modules/site_config') diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp index b5d0f32d..256de1a1 100644 --- a/puppet/modules/site_config/manifests/default.pp +++ b/puppet/modules/site_config/manifests/default.pp @@ -7,18 +7,6 @@ class site_config::default { include site_config::params include site_config::setup - # By default, the class 'site_config::slow' is included in site.pp. - # It basically does an 'apt-get update' and 'apt-get dist-upgrade'. - # This class can be excluded by using 'leap deploy --fast', - # see https://leap.se/en/docs/platform/details/under-the-hood#tags for more - # details. - # The following Package resource override makes sure that *if* an - # 'apt-get update' is executed by 'site_config::slow', it should be done - # before any packages are installed. - - Package { require => Exec['apt_updated'] } - - # default class, used by all hosts include lsb, git -- cgit v1.2.3