X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=fuel-plugin%2Fdeployment_scripts%2Fpuppet%2Fmanifests%2Fkvm-install.pp;h=fba3e38ce785a5a555650bbb71a21bfb9e5d8368;hb=4a69d386c55f01ef3645ad500d232f27fc7c2444;hp=a396e9472e751b5980c940a75e179ece24d7e585;hpb=8647dbbe9db84d71610f42cec6ff619783d99800;p=kvmfornfv.git diff --git a/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp b/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp index a396e9472..fba3e38ce 100644 --- a/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp +++ b/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp @@ -1,17 +1,32 @@ -$fuel_settings = parseyaml(file('/etc/astute.yaml')) -if $operatingsystem == 'Ubuntu' { - if $fuel_settings['fuel-plugin-kvm']['use_kvm'] { - package { 'linux-headers-4.4.6-rt14nfv': - ensure => "1.0.OPNFV", - } -> - package { 'linux-image-4.4.6-rt14nfv': - ensure => "1.0.OPNFV", - } -> - exec {'reboot': - command => "reboot", - path => "/usr/bin:/usr/sbin:/bin:/sbin", - } - } else { - } -} elsif $operatingsystem == 'CentOS' { +$kvm_settings = hiera('fuel-plugin-kvm') + +case $::operatingsystem { + 'Ubuntu': { + $version = '4.4.6-rt14nfv' + $kernel_kit = ["linux-headers-${version}", "linux-image-${version}"] + $kernel_src = "/usr/src/linux-headers-${version}" + $kernel_src_link = "/lib/modules/${version}/build" + } + default: { + fail("Unsupported operating system: ${::osfamily}/${::operatingsystem}") + } + +} + +if $kvm_settings['use_kvm'] { + $ensure_pkg = '1.0.OPNFV' + $ensure_link = 'link' +} else { + $ensure_pkg = 'purged' + $ensure_link = 'absent' +} + +package { $kernel_kit: + ensure => $ensure_pkg, + before => File[$kernel_src_link], +} + +file { $kernel_src_link: + ensure => $ensure_link, + target => $kernel_src, }