From d69d87f1331794397aea4f08c1279976e2892764 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 13 May 2015 17:16:37 +0200 Subject: [PATCH] * Use the stdlib function 'ensure_packages' to install recommended packages instead of 'if ! defined'. --- CHANGELOG.md | 1 + README.md | 4 ++-- manifests/hypervisor/install.pp | 10 +--------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4efa5f..f565a65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ##### Changes * Some installation's instructions only run if running a PVE kernel (test the new is_pve_kernel fact). +* Use the stdlib function 'ensure_packages' to install recommended packages instead of 'if ! defined'. ##### Bugfixes * #14 The module no longer automatically reboot nodes after kernel upgrade, show a warning message instead. diff --git a/README.md b/README.md index 9ffa2e5..6ec431b 100644 --- a/README.md +++ b/README.md @@ -105,14 +105,14 @@ node "pve_node" { # Verify the authenticity of each hosts (/etc/ssh/ssh_host_{rsa,ecdsa}_key.pub) sshkey { 'hyper01': ensure => present, - host_aliases => [ 'hyper01.ipr.univ-rennes1.fr', '192.168.42.201' ], + host_aliases => [ 'hyper01.domain.org', '192.168.42.201' ], key => 'AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJ3TC6B3+eVbohjk662FwM/1YUCjMwMT9lmZcNcfllF9Vm082lMXtKix20elUCK9yJDpPWvzFiqdyhgqPAeCNt4=', target => '/root/.ssh/known_hosts', type => 'ecdsa-sha2-nistp256', } sshkey { 'hyper02': ensure => present, - host_aliases => [ 'hyper02.ipr.univ-rennes1.fr', '192.168.42.202' ], + host_aliases => [ 'hyper02.domain.org', '192.168.42.202' ], key => 'AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEqUpnig3DIQVZEr3LxJCVEF/fl4n1s8LNuUUaLRueCW2ygzNBOv2m7O42K/Ok7aa4kjGaXbnneYXMw3wBULJ1U=' target => '/root/.ssh/known_hosts', type => 'ecdsa-sha2-nistp256', diff --git a/manifests/hypervisor/install.pp b/manifests/hypervisor/install.pp index 71687bc..fd47eb9 100644 --- a/manifests/hypervisor/install.pp +++ b/manifests/hypervisor/install.pp @@ -24,15 +24,7 @@ class proxmox::hypervisor::install { } # Ensure that some recommended packages are present on the system - # come from Proxmox and standard Debian repository - ## The variable needs double quote to take the array - if ! defined(Package["${proxmox::hypervisor::rec_pkg_name}"]) { - package { $proxmox::hypervisor::rec_pkg_name: - ensure => $proxmox::hypervisor::ve_pkg_ensure, - } - } else { - notice("Warn: can't manage ${proxmox::hypervisor::rec_pkg_name}.") - } + ensure_packages( $proxmox::hypervisor::rec_pkg_name ) } else { # If the system run on a standard Debian Kernel