diff options
author | varac <varacanero@zeromail.org> | 2016-01-28 00:04:10 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-01-28 23:52:41 +0100 |
commit | a8343508a6ced1dcbca621ad4c6f3ac39676326b (patch) | |
tree | be4c0b141f9fb1647841c6ac65a9169d8faaf2e3 | |
parent | 54bd11793c13140651d908db7f88d550712ee85a (diff) |
[feat] Fix fast deploy using 'leap deploy --fast'
This worked before, but somehow stopped working.
We need to include 'site_config::slow' top-level scope instead
of including it in 'site_config::default', because otherwise it
would get tagged with 'leap_base', and would be included always.
This way 'site_config::slow' gets included by default, but can be
excluded by using 'leap deploy --fast'.
See https://leap.se/en/docs/platform/details/under-the-hood#tags
- Resolves: #7844
-rw-r--r-- | puppet/manifests/site.pp | 9 | ||||
-rw-r--r-- | puppet/modules/site_config/manifests/default.pp | 14 | ||||
-rw-r--r-- | puppet/modules/site_config/manifests/slow.pp | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 6bafff8e..f012d6c8 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -11,6 +11,15 @@ $services = hiera('services', []) $services_str = join($services, ', ') notice("Services for ${fqdn}: ${services_str}") +# In the default deployment case, we want to run an 'apt-get dist-upgrade' +# to ensure the latest packages are installed. This is done by including the +# class 'site_config::slow' here. However, you only changed a small bit of +# the platform and want to skip this slow part of deployment, you can do that +# by using 'leap deploy --fast' which will only apply those resources that are +# tagged with 'leap_base' or 'leap_service'. +# See https://leap.se/en/docs/platform/details/under-the-hood#tags +include site_config::slow + if member($services, 'openvpn') { include site_openvpn } diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp index 7a2a0a79..96f06e6c 100644 --- a/puppet/modules/site_config/manifests/default.pp +++ b/puppet/modules/site_config/manifests/default.pp @@ -7,11 +7,17 @@ class site_config::default { include site_config::params include site_config::setup - # make sure apt is updated before any packages are installed - include apt::update - Package { require => Exec['apt_updated'] } + # 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['refresh_apt'] } - include site_config::slow # default class, used by all hosts diff --git a/puppet/modules/site_config/manifests/slow.pp b/puppet/modules/site_config/manifests/slow.pp index 3650eb19..de276bc3 100644 --- a/puppet/modules/site_config/manifests/slow.pp +++ b/puppet/modules/site_config/manifests/slow.pp @@ -3,5 +3,7 @@ # the "--fast" parameter class site_config::slow { tag 'leap_slow' + + include apt::update class { 'site_apt::dist_upgrade': } } |