summaryrefslogtreecommitdiffstats
path: root/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp
blob: 0ca9a8d380bb733e27853ef8445d84ec423d7026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$kvm_settings = hiera('fuel-plugin-kvm')

case $::operatingsystem {
  'Ubuntu': {
    $version         = '4.4.50-rt62nfv'
    $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,
}