Skip to content

Commit

Permalink
Use ensure_packages to simpify packages management
Browse files Browse the repository at this point in the history
Thanks to stdlib's ensure_packages (available from stdlib 3.2.0,
released in 2012) we can avoid the virtual resources.
  • Loading branch information
smortex committed Jul 3, 2018
1 parent c0c5cf5 commit f954814
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
7 changes: 1 addition & 6 deletions manifests/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,13 @@
default: { fail('No db_type set') }
}

# Packages are virtual due to some platforms shipping the SD and Dir as
# part of the same package.
include ::bacula::virtual

# Allow for package names to include EPP syntax for db_type
$package_names = $packages.map |$p| {
$package_name = inline_epp($p, {
'db_type' => $db_type
})
}

realize(Package[$package_names])
ensure_packages($package_names)

service { $services:
ensure => running,
Expand Down
6 changes: 1 addition & 5 deletions manifests/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,14 @@
String $user = $bacula::bacula_user,
) inherits ::bacula {

# Packages are virtual due to some platforms shipping the
# SD and Dir as part of the same package.
include ::bacula::virtual

# Allow for package names to include EPP syntax for db_type
$db_type = lookup('bacula::director::db_type')
$package_names = $packages.map |$p| {
$package_name = inline_epp($p, {
'db_type' => $db_type
})
}
realize(Package[$package_names])
ensure_packages($package_names)

service { $services:
ensure => running,
Expand Down
28 changes: 0 additions & 28 deletions manifests/virtual.pp

This file was deleted.

0 comments on commit f954814

Please sign in to comment.