summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertagaz <bertagaz@ptitcanardnoir.org>2017-10-21 15:26:49 +0200
committerbertagaz <bertagaz@ptitcanardnoir.org>2017-10-21 15:44:27 +0200
commit304db9e0e7b8017d61b42bc4ac686f96e30e4106 (patch)
treeaf20c0eb31281bf897db5c33f7f9bb1b106f0460
parentfb72d65614fb35ae4d7ecc89cdb7a2a38c26aa1d (diff)
Add a mechanism to remove leftovers from tails::builder.feature/11972-use-vagrant-in-jenkins
tails::builder does not provide a way to set `$ensure` to absent for all its resources. Rather than implementing it in the class supposed to be removed, let's just transition by removing leftovers in the new tails::iso_builder manifest. It also removes leftovers from the tails::website_builder classe which are not needed anymore on Jenkins isobuilders. This commit can be reverted once we decide no more tails::builder manifests are in use. Refs: #12505
-rw-r--r--manifests/iso_builder.pp57
1 files changed, 57 insertions, 0 deletions
diff --git a/manifests/iso_builder.pp b/manifests/iso_builder.pp
index bdec6b3..87800b5 100644
--- a/manifests/iso_builder.pp
+++ b/manifests/iso_builder.pp
@@ -1,5 +1,6 @@
class tails::iso_builder (
$ensure = present,
+ $cleanup_pre_vagrant_build_deps = true,
) {
### Sanity checks
@@ -8,6 +9,8 @@ class tails::iso_builder (
fail('The tails::iso_builder module only supports Debian Stretch.')
}
+ validate_bool($cleanup_pre_vagrant_build_deps)
+
### Resources
$package_ensure = $ensure ? {
@@ -36,4 +39,58 @@ class tails::iso_builder (
{'ensure' => $package_ensure}
)
+ # XXX: cleanup packages and configuration files from the deprecated
+ # tails::builder ISO builder manifest. This should allow to gracefully
+ # automate the cleaning of its leftovers for installations that switch to
+ # the new Vagrant iso_builder manifest. Shall be removed when we decide
+ # every installations had time to switch.
+ if $cleanup_pre_vagrant_build_deps {
+
+ apt::sources_list { "tails-builder-${::lsbdistcodename}.list":
+ ensure => absent,
+ }
+
+ $preferences_snippets = [
+ 'debootstrap',
+ 'live-build',
+ 'ikiwiki',
+ 'discount',
+ 'libmarkdown2',
+ 'libmarkdown2-dev',
+ ]
+
+ apt::preferences_snippet { $preferences_snippets:
+ ensure => absent,
+ }
+
+ $packages = [
+ 'ikiwiki',
+ 'perlmagick',
+ 'po4a',
+ 'dpkg-dev',
+ 'eatmydata',
+ 'intltool',
+ 'libfile-slurp-perl',
+ 'liblist-moreutils-perl',
+ 'live-build',
+ 'syslinux-utils',
+ 'time',
+ 'whois',
+ ]
+
+ package { $packages:
+ ensure => 'purged',
+ }
+
+ $files = [
+ '/etc/live',
+ '/etc/live/build.conf',
+ '/etc/sudoers.d/tails-builder-defaults',
+ ]
+
+ file { $files:
+ ensure => absent,
+ }
+ }
+
}