comparison modules/php/manifests/packages.pp @ 386:3fce34f642f1

Add a PHP module to handle platform differences
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Jan 2022 17:09:39 +0000
parents
children
comparison
equal deleted inserted replaced
385:d9009f54eb23 386:3fce34f642f1
1 # Install common PHP packages
2 #
3 # === Parameters
4 #
5 # [*ensure*]
6 # Specify which version of PHP packages to install
7 #
8 # [*names*]
9 # List of the names of the package to install
10 #
11 # [*names_to_prefix*]
12 # List of packages names that should be prefixed with the common
13 # package prefix `$php::package_prefix`
14 #
15 class php::packages (
16 String $ensure = $php::ensure,
17 Boolean $manage_repos = $php::manage_repos,
18 Array $names_to_prefix = prefix($php::params::common_package_suffixes, $php::package_prefix),
19 Array $names = $php::params::common_package_names,
20 ) inherits php::params {
21 assert_private()
22
23 $real_names = union($names, $names_to_prefix)
24 if $facts['os']['family'] == 'Debian' {
25 if $manage_repos {
26 include apt
27 Class['apt::update'] -> Package[$real_names]
28 }
29 package { $real_names:
30 ensure => $ensure,
31 }
32 } else {
33 package { $real_names:
34 ensure => $ensure,
35 }
36 }
37 }