* Use the stdlib function 'ensure_packages' to install recommended packages instead of 'if ! defined'.

This commit is contained in:
gardouille 2015-05-13 17:16:37 +02:00
parent e0ef2304f0
commit d69d87f133
3 changed files with 4 additions and 11 deletions

View File

@ -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.

View File

@ -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',

View File

@ -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