Get the host_uuid for libvirt from hiera
* Fetch host_uuid from hiera * Preserve the default value as is to keep this change backwards compatible. * Fix the uuid idempotency issue for Noop tests: add host_uuid to the Noop astute.yaml templates for compute as if it was put there from the Nailgun backend. Closes-bug: #1517915 Change-Id: I7437e56a7666abd32564acb715eb17c220a4896e Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
parent
b9f8c28f0e
commit
55cc0d2d2d
@ -78,6 +78,8 @@ class openstack::compute (
|
|||||||
$glance_api_servers = undef,
|
$glance_api_servers = undef,
|
||||||
# Virtualization
|
# Virtualization
|
||||||
$libvirt_type = 'kvm',
|
$libvirt_type = 'kvm',
|
||||||
|
# FIXME(bogdando) remove after fixed upstream https://review.openstack.org/131710
|
||||||
|
$host_uuid = undef,
|
||||||
# VNC
|
# VNC
|
||||||
$vnc_enabled = true,
|
$vnc_enabled = true,
|
||||||
$vncproxy_host = undef,
|
$vncproxy_host = undef,
|
||||||
@ -229,8 +231,6 @@ class openstack::compute (
|
|||||||
notify => Service['libvirt'],
|
notify => Service['libvirt'],
|
||||||
}
|
}
|
||||||
|
|
||||||
$host_uuid=generate('/bin/sh', '-c', "uuidgen")
|
|
||||||
|
|
||||||
augeas { 'libvirt-conf-uuid':
|
augeas { 'libvirt-conf-uuid':
|
||||||
context => '/files/etc/libvirt/libvirtd.conf',
|
context => '/files/etc/libvirt/libvirtd.conf',
|
||||||
changes => [
|
changes => [
|
||||||
|
@ -15,6 +15,7 @@ describe 'openstack::compute' do
|
|||||||
:rabbit_ha_queues => false,
|
:rabbit_ha_queues => false,
|
||||||
:glance_api_servers => 'undef',
|
:glance_api_servers => 'undef',
|
||||||
:libvirt_type => 'kvm',
|
:libvirt_type => 'kvm',
|
||||||
|
:host_uuid => nil,
|
||||||
:vnc_enabled => true,
|
:vnc_enabled => true,
|
||||||
:vncproxy_host => false,
|
:vncproxy_host => false,
|
||||||
:vncserver_listen => '0.0.0.0',
|
:vncserver_listen => '0.0.0.0',
|
||||||
@ -142,6 +143,10 @@ describe 'openstack::compute' do
|
|||||||
:compute_driver => p[:compute_driver],
|
:compute_driver => p[:compute_driver],
|
||||||
:libvirt_service_name => 'libvirtd'
|
:libvirt_service_name => 'libvirtd'
|
||||||
)
|
)
|
||||||
|
should contain_augeas('libvirt-conf-uuid').with(
|
||||||
|
:context => '/files/etc/libvirt/libvirtd.conf',
|
||||||
|
:changes => "set host_uuid #{p[:host_uuid]}"
|
||||||
|
).that_notifies('Service[libvirt]')
|
||||||
if facts[:osfamily] == 'RedHat'
|
if facts[:osfamily] == 'RedHat'
|
||||||
should contain_file_line('no_qemu_selinux')
|
should contain_file_line('no_qemu_selinux')
|
||||||
elsif facts[:osfamily] == 'Debian'
|
elsif facts[:osfamily] == 'Debian'
|
||||||
|
@ -233,6 +233,8 @@ class { 'openstack::compute':
|
|||||||
private_interface => $use_neutron ? { true=>false, default=>hiera('private_int', undef)},
|
private_interface => $use_neutron ? { true=>false, default=>hiera('private_int', undef)},
|
||||||
internal_address => get_network_role_property('nova/api', 'ipaddr'),
|
internal_address => get_network_role_property('nova/api', 'ipaddr'),
|
||||||
libvirt_type => hiera('libvirt_type', undef),
|
libvirt_type => hiera('libvirt_type', undef),
|
||||||
|
# FIXME(bogdando) remove after fixed upstream https://review.openstack.org/131710
|
||||||
|
host_uuid => hiera('host_uuid', generate('/bin/sh', '-c', 'uuidgen')),
|
||||||
fixed_range => $use_neutron ? { true=>false, default=>hiera('fixed_network_range', undef)},
|
fixed_range => $use_neutron ? { true=>false, default=>hiera('fixed_network_range', undef)},
|
||||||
network_manager => hiera('network_manager', undef),
|
network_manager => hiera('network_manager', undef),
|
||||||
network_config => hiera('network_config', {}),
|
network_config => hiera('network_config', {}),
|
||||||
|
@ -119,6 +119,7 @@ syslog:
|
|||||||
weight: 50
|
weight: 50
|
||||||
label: Syslog
|
label: Syslog
|
||||||
libvirt_type: qemu
|
libvirt_type: qemu
|
||||||
|
host_uuid: '00000000-0000-0000-0000-000000000000'
|
||||||
puppet:
|
puppet:
|
||||||
modules: rsync://10.122.10.2:/puppet/2015.1.0-8.0/modules/
|
modules: rsync://10.122.10.2:/puppet/2015.1.0-8.0/modules/
|
||||||
manifests: rsync://10.122.10.2:/puppet/2015.1.0-8.0/manifests/
|
manifests: rsync://10.122.10.2:/puppet/2015.1.0-8.0/manifests/
|
||||||
|
@ -119,6 +119,7 @@ syslog:
|
|||||||
weight: 50
|
weight: 50
|
||||||
label: Syslog
|
label: Syslog
|
||||||
libvirt_type: qemu
|
libvirt_type: qemu
|
||||||
|
host_uuid: '00000000-0000-0000-0000-000000000000'
|
||||||
puppet:
|
puppet:
|
||||||
modules: rsync://10.122.5.2:/puppet/2015.1.0-8.0/modules/
|
modules: rsync://10.122.5.2:/puppet/2015.1.0-8.0/modules/
|
||||||
manifests: rsync://10.122.5.2:/puppet/2015.1.0-8.0/manifests/
|
manifests: rsync://10.122.5.2:/puppet/2015.1.0-8.0/manifests/
|
||||||
|
@ -119,6 +119,7 @@ syslog:
|
|||||||
weight: 50
|
weight: 50
|
||||||
label: Syslog
|
label: Syslog
|
||||||
libvirt_type: qemu
|
libvirt_type: qemu
|
||||||
|
host_uuid: '00000000-0000-0000-0000-000000000000'
|
||||||
puppet:
|
puppet:
|
||||||
modules: rsync://10.122.5.2:/puppet/2015.1.0-8.0/modules/
|
modules: rsync://10.122.5.2:/puppet/2015.1.0-8.0/modules/
|
||||||
manifests: rsync://10.122.5.2:/puppet/2015.1.0-8.0/manifests/
|
manifests: rsync://10.122.5.2:/puppet/2015.1.0-8.0/manifests/
|
||||||
|
@ -91,6 +91,7 @@ keystone:
|
|||||||
db_password: e4Op1FQB
|
db_password: e4Op1FQB
|
||||||
last_controller: node-125
|
last_controller: node-125
|
||||||
libvirt_type: qemu
|
libvirt_type: qemu
|
||||||
|
host_uuid: '00000000-0000-0000-0000-000000000000'
|
||||||
management_network_range: 192.168.0.0/24
|
management_network_range: 192.168.0.0/24
|
||||||
management_vip: 192.168.0.6
|
management_vip: 192.168.0.6
|
||||||
management_vrouter_vip: 192.168.0.7
|
management_vrouter_vip: 192.168.0.7
|
||||||
|
@ -91,6 +91,7 @@ keystone:
|
|||||||
db_password: 32TWl29R
|
db_password: 32TWl29R
|
||||||
last_controller: node-131
|
last_controller: node-131
|
||||||
libvirt_type: qemu
|
libvirt_type: qemu
|
||||||
|
host_uuid: '00000000-0000-0000-0000-000000000000'
|
||||||
management_network_range: 192.168.0.0/24
|
management_network_range: 192.168.0.0/24
|
||||||
management_vip: 192.168.0.6
|
management_vip: 192.168.0.6
|
||||||
management_vrouter_vip: 192.168.0.7
|
management_vrouter_vip: 192.168.0.7
|
||||||
|
@ -97,6 +97,7 @@ keystone:
|
|||||||
db_password: MnrQiwLn
|
db_password: MnrQiwLn
|
||||||
last_controller: node-137
|
last_controller: node-137
|
||||||
libvirt_type: qemu
|
libvirt_type: qemu
|
||||||
|
host_uuid: '00000000-0000-0000-0000-000000000000'
|
||||||
management_network_range: 192.168.0.0/24
|
management_network_range: 192.168.0.0/24
|
||||||
management_vip: 192.168.0.5
|
management_vip: 192.168.0.5
|
||||||
management_vrouter_vip: 192.168.0.6
|
management_vrouter_vip: 192.168.0.6
|
||||||
|
@ -5,15 +5,15 @@ manifest = 'roles/compute.pp'
|
|||||||
describe manifest do
|
describe manifest do
|
||||||
shared_examples 'catalog' do
|
shared_examples 'catalog' do
|
||||||
|
|
||||||
storage_hash = Noop.hiera_structure 'storage'
|
storage_hash = Noop.hiera_structure 'storage'
|
||||||
ironic_enabled = Noop.hiera_structure 'ironic/enabled'
|
ironic_enabled = Noop.hiera_structure 'ironic/enabled'
|
||||||
|
|
||||||
if ironic_enabled
|
if ironic_enabled
|
||||||
compute_driver = 'ironic.IronicDriver'
|
compute_driver = 'ironic.IronicDriver'
|
||||||
else
|
else
|
||||||
compute_driver = 'libvirt.LibvirtDriver'
|
compute_driver = 'libvirt.LibvirtDriver'
|
||||||
end
|
end
|
||||||
it 'should declare class nova::compute with install_bridge_utils set to false' do
|
it 'should declare class nova::compute with install_bridge_utils set to false' do
|
||||||
should contain_class('nova::compute').with(
|
should contain_class('nova::compute').with(
|
||||||
'install_bridge_utils' => false,
|
'install_bridge_utils' => false,
|
||||||
)
|
)
|
||||||
|
@ -5,6 +5,8 @@ manifest = 'roles/compute.pp'
|
|||||||
describe manifest do
|
describe manifest do
|
||||||
shared_examples 'catalog' do
|
shared_examples 'catalog' do
|
||||||
|
|
||||||
|
host_uuid = Noop.hiera 'host_uuid'
|
||||||
|
|
||||||
# Libvirtd.conf
|
# Libvirtd.conf
|
||||||
it 'should configure listen_tls, listen_tcp and auth_tcp in libvirtd.conf' do
|
it 'should configure listen_tls, listen_tcp and auth_tcp in libvirtd.conf' do
|
||||||
should contain_augeas('libvirt-conf').with(
|
should contain_augeas('libvirt-conf').with(
|
||||||
@ -17,6 +19,13 @@ describe manifest do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should configure libvirt host_uuid' do
|
||||||
|
should contain_augeas('libvirt-conf-uuid').with(
|
||||||
|
:context => '/files/etc/libvirt/libvirtd.conf',
|
||||||
|
:changes => "set host_uuid #{host_uuid}"
|
||||||
|
).that_notifies('Service[libvirt]')
|
||||||
|
end
|
||||||
|
|
||||||
# libvirt/qemu with(out) selinux/apparmor
|
# libvirt/qemu with(out) selinux/apparmor
|
||||||
it 'libvirt/qemu config should have proper security_driver and apparmor configuration' do
|
it 'libvirt/qemu config should have proper security_driver and apparmor configuration' do
|
||||||
if facts[:osfamily] == 'RedHat'
|
if facts[:osfamily] == 'RedHat'
|
||||||
|
Loading…
Reference in New Issue
Block a user