From 25c6dddcac77e34cbd201299eca7de48bb1c03b6 Mon Sep 17 00:00:00 2001 From: Igor Belikov Date: Tue, 2 Feb 2016 19:53:35 +0300 Subject: [PATCH] Get debian kernel headers based on architecture This makes possible to apply openstack_project::slave_common class to debian in chroot, e.g. to create a debian image with puppet element using diskimage-builder Change-Id: I7a661c8b5d4bb632eb32b5018c55474c1c66a4e8 --- .../openstack_project/manifests/slave_common.pp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/openstack_project/manifests/slave_common.pp b/modules/openstack_project/manifests/slave_common.pp index a4d7612ce4..45678c3084 100644 --- a/modules/openstack_project/manifests/slave_common.pp +++ b/modules/openstack_project/manifests/slave_common.pp @@ -108,9 +108,20 @@ class openstack_project::slave_common( } 'Debian': { if ($::operatingsystem == 'Debian') { - # install depending on kernel release - if ! defined(Package["linux-headers-${::kernelrelease}"]) { - package { "linux-headers-${::kernelrelease}": + # install depending on architecture + case $::architecture { + 'amd64', 'x86_64': { + $headers_package = ['linux-headers-amd64'] + } + 'x86': { + $headers_package = ['linux-headers-686-pae'] + } + default: { + $headers_package = ["linux-headers-${::kernelrelease}"] + } + } + if ! defined(Package[$headers_package]) { + package { $headers_package: ensure => present, } }