Skip to content

Commit 07a7367

Browse files
committed
Handle config_drive_format option
In order to mount a config drive as CD-ROM the 'genisoimage' package should be explicitly installed on Compute nodes. Change-Id: I197261300ee8c02101b0f3ed9b92bac1006d4ebe
1 parent acfd934 commit 07a7367

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

manifests/compute.pp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
$compute_manager = 'nova.compute.manager.ComputeManager',
151151
$heal_instance_info_cache_interval = '60',
152152
$pci_passthrough = undef,
153-
$config_drive_format = undef,
153+
$config_drive_format = $::os_service_default,
154154
$allow_resize_to_same_host = false,
155155
$vcpu_pin_set = $::os_service_default,
156156
# DEPRECATED PARAMETERS
@@ -262,9 +262,14 @@
262262
}
263263
}
264264

265-
if ($config_drive_format) {
266-
nova_config {
267-
'DEFAULT/config_drive_format': value => $config_drive_format;
268-
}
265+
if is_service_default($config_drive_format) or $config_drive_format == 'iso9660' {
266+
ensure_packages($::nova::params::genisoimage_package_name, {
267+
tag => ['openstack', 'nova-support-package'],
268+
})
269+
}
270+
271+
nova_config {
272+
'DEFAULT/config_drive_format': value => $config_drive_format;
269273
}
274+
270275
}

manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
$sqlite_package_name = undef
3030
$pymysql_package_name = undef
3131
$ceph_client_package_name = 'ceph-common'
32+
$genisoimage_package_name = 'genisoimage'
3233
# service names
3334
$api_service_name = 'openstack-nova-api'
3435
$cells_service_name = 'openstack-nova-cells'
@@ -88,6 +89,7 @@
8889
$sqlite_package_name = 'python-pysqlite2'
8990
$pymysql_package_name = 'python-pymysql'
9091
$ceph_client_package_name = 'ceph'
92+
$genisoimage_package_name = 'genisoimage'
9193
# service names
9294
$api_service_name = 'nova-api'
9395
$cells_service_name = 'nova-cells'

spec/classes/nova_compute_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
end
4444

4545
it { is_expected.to contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('60') }
46+
47+
it 'installs genisoimage package and sets config_drive_format' do
48+
is_expected.to contain_nova_config('DEFAULT/config_drive_format').with(:value => '<SERVICE DEFAULT>')
49+
is_expected.to contain_package('genisoimage').with(
50+
:ensure => 'present',
51+
)
52+
is_expected.to contain_package('genisoimage').that_requires('Anchor[nova::install::begin]')
53+
is_expected.to contain_package('genisoimage').that_comes_before('Anchor[nova::install::end]')
54+
end
4655
end
4756

4857
context 'with overridden parameters' do
@@ -116,6 +125,9 @@
116125
end
117126
it 'configures nova config_drive_format to vfat' do
118127
is_expected.to contain_nova_config('DEFAULT/config_drive_format').with_value('vfat')
128+
is_expected.to_not contain_package('genisoimage').with(
129+
:ensure => 'present',
130+
)
119131
end
120132
end
121133

0 commit comments

Comments
 (0)