Added a new profile to manage common packages
* will by default pull data from hiera * could change it on a per-distro/role basis * requires stdlib for ensure_packages
This commit is contained in:
parent
568da5883e
commit
d48283734c
@ -3,6 +3,24 @@ profiles::base::ntp_servers:
|
||||
- 0.au.pool.ntp.org
|
||||
- 1.au.pool.ntp.org
|
||||
|
||||
profiles::base::packages::common:
|
||||
- ccze
|
||||
- curl
|
||||
- dstat
|
||||
- htop
|
||||
- mtr
|
||||
- ncdu
|
||||
- neovim
|
||||
- python3
|
||||
- screen
|
||||
- strace
|
||||
- sudo
|
||||
- tmux
|
||||
- vim
|
||||
- vnstat
|
||||
- wget
|
||||
- zsh
|
||||
|
||||
profiles::puppet::autosign::subnet_ranges:
|
||||
- '198.18.17.0/24'
|
||||
|
||||
|
||||
@ -16,4 +16,9 @@ class profiles::base (
|
||||
fail("Unsupported OS family ${facts['os']['family']}")
|
||||
}
|
||||
}
|
||||
|
||||
class { 'profiles::base::packages':
|
||||
packages => hiera('profiles::base::packages::common'),
|
||||
ensure => 'installed',
|
||||
}
|
||||
}
|
||||
|
||||
27
site/profiles/manifests/base/packages.pp
Normal file
27
site/profiles/manifests/base/packages.pp
Normal file
@ -0,0 +1,27 @@
|
||||
# This class manages the installation of packages for the base profile
|
||||
#
|
||||
# Parameters:
|
||||
# - $packages: An array of package names to be installed (optional)
|
||||
#
|
||||
# Description:
|
||||
# This class installs a list of packages specified in the $packages parameter
|
||||
# using the `package` resource from Puppet. Each package in the array is installed
|
||||
# with the `ensure => installed` attribute, ensuring that the package is present
|
||||
# on the target system. By default, the class retrieves the package list from Hiera
|
||||
# using the key 'profiles::base::packages::common'.
|
||||
#
|
||||
# Example usage:
|
||||
# class { 'profiles::base::packages':
|
||||
# packages => ['package1', 'package2', 'package3'],
|
||||
#
|
||||
class profiles::base::packages (
|
||||
Array $packages,
|
||||
Enum[
|
||||
'present',
|
||||
'absent',
|
||||
'latest',
|
||||
'installed'
|
||||
] $ensure = 'installed',
|
||||
){
|
||||
ensure_packages($packages, {'ensure' => $ensure})
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user