From 8b0e7d45261c8305d33effb3ccf83df7e5710515 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 15 Aug 2016 15:28:23 -0400 Subject: Defaults empty hash to kernel_modules and sysctl_settings Set empty hash by default to kernel_modules and sysctl_settings so catalog won't fail if the parameters are not set in Hiera. Change-Id: I24ab535b01e2724af457d39c03cd990c574ef0aa --- manifests/profile/base/kernel.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'manifests/profile') diff --git a/manifests/profile/base/kernel.pp b/manifests/profile/base/kernel.pp index db0280f..df13a98 100644 --- a/manifests/profile/base/kernel.pp +++ b/manifests/profile/base/kernel.pp @@ -19,8 +19,12 @@ # class tripleo::profile::base::kernel { - create_resources(kmod::load, hiera('kernel_modules'), { }) - create_resources(sysctl::value, hiera('sysctl_settings'), { }) - Exec <| tag == 'kmod::load' |> -> Sysctl <| |> + if hiera('kernel_modules', undef) { + create_resources(kmod::load, hiera('kernel_modules'), { }) + } + if hiera('sysctl_settings', undef) { + create_resources(sysctl::value, hiera('sysctl_settings'), { }) + } + Exec <| tag == 'kmod::load' |> -> Sysctl <| |> } -- cgit 1.2.3-korg