require sections are specified in nova_config
This massive code commit actually implements something very simple. previously, we allowed nova_config to omit a section and assumed that section was default. This commit updates the code to require section names for all settings. This change is being made b/c: - it better maps to the config on disk - it is consistent with the other modules Change-Id: Iae71a4c48ed0f9792566f16f0bf13e61569b46e5
This commit is contained in:
parent
258e4f41a7
commit
c9757ec448
|
@ -6,16 +6,14 @@ Puppet::Type.type(:nova_config).provide(
|
|||
# the setting is always default
|
||||
# this if for backwards compat with the old puppet providers for nova_config
|
||||
def section
|
||||
section_setting = resource[:name].split('/', 2)
|
||||
section_setting.size == 2 ? section_setting.first : 'DEFAULT'
|
||||
resource[:name].split('/', 2)[0]
|
||||
end
|
||||
|
||||
# assumes that the name was the setting
|
||||
# this is to maintain backwards compat with the the older
|
||||
# stuff
|
||||
def setting
|
||||
section_setting = resource[:name].split('/', 2)
|
||||
section_setting.size == 2 ? section_setting.last : resource[:name]
|
||||
resource[:name].split('/', 2)[1]
|
||||
end
|
||||
|
||||
def separator
|
||||
|
|
|
@ -7,7 +7,11 @@ Puppet::Type.newtype(:nova_config) do
|
|||
ensurable
|
||||
|
||||
newparam(:name, :namevar => true) do
|
||||
newvalues(/^\S+$/, /\S+\/\S+/)
|
||||
validate do |value|
|
||||
unless value =~ /\S+\/\S+/
|
||||
fail("Invalid nova_config #{value}, entries without sections are no longer supported, please add an explicit section (probably DEFAULT) to all nova_config resources")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
newproperty(:value) do
|
||||
|
|
|
@ -50,13 +50,13 @@ class nova::api(
|
|||
}
|
||||
|
||||
nova_config {
|
||||
'api_paste_config': value => '/etc/nova/api-paste.ini';
|
||||
'enabled_apis': value => $enabled_apis;
|
||||
'volume_api_class': value => $volume_api_class;
|
||||
'ec2_listen': value => $api_bind_address;
|
||||
'osapi_compute_listen': value => $api_bind_address;
|
||||
'metadata_listen': value => $api_bind_address;
|
||||
'osapi_volume_listen': value => $api_bind_address;
|
||||
'DEFAULT/api_paste_config': value => '/etc/nova/api-paste.ini';
|
||||
'DEFAULT/enabled_apis': value => $enabled_apis;
|
||||
'DEFAULT/volume_api_class': value => $volume_api_class;
|
||||
'DEFAULT/ec2_listen': value => $api_bind_address;
|
||||
'DEFAULT/osapi_compute_listen': value => $api_bind_address;
|
||||
'DEFAULT/metadata_listen': value => $api_bind_address;
|
||||
'DEFAULT/osapi_volume_listen': value => $api_bind_address;
|
||||
}
|
||||
|
||||
nova_paste_api_ini {
|
||||
|
|
|
@ -19,14 +19,14 @@ class nova::compute(
|
|||
$vncproxy_base_url = "${vncproxy_protocol}://${vncproxy_host}:${vncproxy_port}${vncproxy_path}"
|
||||
# config for vnc proxy
|
||||
nova_config {
|
||||
'novncproxy_base_url': value => $vncproxy_base_url;
|
||||
'DEFAULT/novncproxy_base_url': value => $vncproxy_base_url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'vnc_enabled': value => $vnc_enabled;
|
||||
'vncserver_proxyclient_address': value => $vncserver_proxyclient_address;
|
||||
'DEFAULT/vnc_enabled': value => $vnc_enabled;
|
||||
'DEFAULT/vncserver_proxyclient_address': value => $vncserver_proxyclient_address;
|
||||
}
|
||||
|
||||
package { 'bridge-utils':
|
||||
|
@ -44,7 +44,7 @@ class nova::compute(
|
|||
|
||||
if $virtio_nic {
|
||||
# Enable the virtio network card for instances
|
||||
nova_config { 'libvirt_use_virtio_for_bridges': value => 'True' }
|
||||
nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => 'True' }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@ class nova::compute::libvirt (
|
|||
}
|
||||
|
||||
nova_config {
|
||||
'compute_driver': value => 'libvirt.LibvirtDriver';
|
||||
'libvirt_type': value => $libvirt_type;
|
||||
'connection_type': value => 'libvirt';
|
||||
'vncserver_listen': value => $vncserver_listen;
|
||||
'DEFAULT/compute_driver': value => 'libvirt.LibvirtDriver';
|
||||
'DEFAULT/libvirt_type': value => $libvirt_type;
|
||||
'DEFAULT/connection_type': value => 'libvirt';
|
||||
'DEFAULT/vncserver_listen': value => $vncserver_listen;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,7 @@ class nova::compute::quantum (
|
|||
){
|
||||
|
||||
nova_config {
|
||||
'libvirt_vif_driver': value => $libvirt_vif_driver;
|
||||
#'libvirt_vif_driver': value => 'nova.virt.libvirt.vif.LibvirtHybirdOVSBridgeDriver';
|
||||
'libvirt_use_virtio_for_bridges': value => 'True';
|
||||
'DEFAULT/libvirt_vif_driver': value => $libvirt_vif_driver;
|
||||
'DEFAULT/libvirt_use_virtio_for_bridges': value => 'True';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@ class nova::compute::xenserver(
|
|||
) {
|
||||
|
||||
nova_config {
|
||||
'connection_type': value => 'xenapi';
|
||||
'xenapi_connection_url': value => $xenapi_connection_url;
|
||||
'xenapi_connection_username': value => $xenapi_connection_username;
|
||||
'xenapi_connection_password': value => $xenapi_connection_password;
|
||||
'xenapi_inject_image': value => $xenapi_inject_image;
|
||||
'DEFAULT/connection_type': value => 'xenapi';
|
||||
'DEFAULT/xenapi_connection_url': value => $xenapi_connection_url;
|
||||
'DEFAULT/xenapi_connection_username': value => $xenapi_connection_username;
|
||||
'DEFAULT/xenapi_connection_password': value => $xenapi_connection_password;
|
||||
'DEFAULT/xenapi_inject_image': value => $xenapi_inject_image;
|
||||
}
|
||||
|
||||
package { 'xenapi':
|
||||
|
|
|
@ -151,74 +151,74 @@ class nova(
|
|||
} else {
|
||||
fail("Invalid db connection ${sql_connection}")
|
||||
}
|
||||
nova_config { 'sql_connection': value => $sql_connection }
|
||||
nova_config { 'DEFAULT/sql_connection': value => $sql_connection }
|
||||
}
|
||||
|
||||
nova_config { 'image_service': value => $image_service }
|
||||
nova_config { 'DEFAULT/image_service': value => $image_service }
|
||||
|
||||
if $image_service == 'nova.image.glance.GlanceImageService' {
|
||||
if $glance_api_servers {
|
||||
nova_config { 'glance_api_servers': value => $glance_api_servers }
|
||||
nova_config { 'DEFAULT/glance_api_servers': value => $glance_api_servers }
|
||||
}
|
||||
}
|
||||
|
||||
nova_config { 'auth_strategy': value => $auth_strategy }
|
||||
nova_config { 'DEFAULT/auth_strategy': value => $auth_strategy }
|
||||
|
||||
if $rpc_backend == 'nova.openstack.common.rpc.impl_kombu' {
|
||||
# I may want to support exporting and collecting these
|
||||
nova_config {
|
||||
'rabbit_password': value => $rabbit_password;
|
||||
'rabbit_userid': value => $rabbit_userid;
|
||||
'rabbit_virtual_host': value => $rabbit_virtual_host;
|
||||
'DEFAULT/rabbit_password': value => $rabbit_password;
|
||||
'DEFAULT/rabbit_userid': value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host;
|
||||
}
|
||||
|
||||
if size($rabbit_hosts) > 1 {
|
||||
nova_config { 'rabbit_ha_queues': value => 'true' }
|
||||
nova_config { 'DEFAULT/rabbit_ha_queues': value => 'true' }
|
||||
} else {
|
||||
nova_config { 'rabbit_ha_queues': value => 'false' }
|
||||
nova_config { 'DEFAULT/rabbit_ha_queues': value => 'false' }
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
nova_config { 'rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
nova_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
} elsif $rabbit_host {
|
||||
nova_config { 'rabbit_host': value => $rabbit_host }
|
||||
nova_config { 'rabbit_port': value => $rabbit_port }
|
||||
nova_config { 'rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
nova_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
nova_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
nova_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
}
|
||||
}
|
||||
|
||||
if $rpc_backend == 'nova.openstack.common.rpc.impl_qpid' {
|
||||
nova_config {
|
||||
'qpid_hostname': value => $qpid_hostname;
|
||||
'qpid_port': value => $qpid_port;
|
||||
'qpid_username': value => $qpid_username;
|
||||
'qpid_password': value => $qpid_password;
|
||||
'qpid_reconnect': value => $qpid_reconnect;
|
||||
'qpid_reconnect_timeout': value => $qpid_reconnect_timeout;
|
||||
'qpid_reconnect_limit': value => $qpid_reconnect_limit;
|
||||
'qpid_reconnect_interval_min': value => $qpid_reconnect_interval_min;
|
||||
'qpid_reconnect_interval_max': value => $qpid_reconnect_interval_max;
|
||||
'qpid_reconnect_interval': value => $qpid_reconnect_interval;
|
||||
'qpid_heartbeat': value => $qpid_heartbeat;
|
||||
'qpid_protocol': value => $qpid_protocol;
|
||||
'qpid_tcp_nodelay': value => $qpid_tcp_nodelay;
|
||||
'DEFAULT/qpid_hostname': value => $qpid_hostname;
|
||||
'DEFAULT/qpid_port': value => $qpid_port;
|
||||
'DEFAULT/qpid_username': value => $qpid_username;
|
||||
'DEFAULT/qpid_password': value => $qpid_password;
|
||||
'DEFAULT/qpid_reconnect': value => $qpid_reconnect;
|
||||
'DEFAULT/qpid_reconnect_timeout': value => $qpid_reconnect_timeout;
|
||||
'DEFAULT/qpid_reconnect_limit': value => $qpid_reconnect_limit;
|
||||
'DEFAULT/qpid_reconnect_interval_min': value => $qpid_reconnect_interval_min;
|
||||
'DEFAULT/qpid_reconnect_interval_max': value => $qpid_reconnect_interval_max;
|
||||
'DEFAULT/qpid_reconnect_interval': value => $qpid_reconnect_interval;
|
||||
'DEFAULT/qpid_heartbeat': value => $qpid_heartbeat;
|
||||
'DEFAULT/qpid_protocol': value => $qpid_protocol;
|
||||
'DEFAULT/qpid_tcp_nodelay': value => $qpid_tcp_nodelay;
|
||||
}
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'verbose': value => $verbose;
|
||||
'logdir': value => $logdir;
|
||||
'rpc_backend': value => $rpc_backend;
|
||||
'DEFAULT/verbose': value => $verbose;
|
||||
'DEFAULT/logdir': value => $logdir;
|
||||
'DEFAULT/rpc_backend': value => $rpc_backend;
|
||||
# Following may need to be broken out to different nova services
|
||||
'state_path': value => $state_path;
|
||||
'lock_path': value => $lock_path;
|
||||
'service_down_time': value => $service_down_time;
|
||||
'rootwrap_config': value => $rootwrap_config;
|
||||
'DEFAULT/state_path': value => $state_path;
|
||||
'DEFAULT/lock_path': value => $lock_path;
|
||||
'DEFAULT/service_down_time': value => $service_down_time;
|
||||
'DEFAULT/rootwrap_config': value => $rootwrap_config;
|
||||
}
|
||||
|
||||
if $monitoring_notifications {
|
||||
nova_config {
|
||||
'notification_driver': value => 'nova.notifier.rabbit_notifier'
|
||||
'DEFAULT/notification_driver': value => 'nova.notifier.rabbit_notifier'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class nova::network(
|
|||
}
|
||||
|
||||
if $floating_range {
|
||||
nova_config { 'floating_range': value => $floating_range }
|
||||
nova_config { 'DEFAULT/floating_range': value => $floating_range }
|
||||
}
|
||||
|
||||
if has_key($config_overrides, 'vlan_start') {
|
||||
|
|
|
@ -14,7 +14,7 @@ define nova::network::bridge ( $ip, $netmask = "255.255.255.0" )
|
|||
"set iface[. = '${name}']/method static",
|
||||
"set iface[. = '${name}']/address ${ip}",
|
||||
"set iface[. = '${name}']/netmask ${netmask}",
|
||||
"set iface[. = '${name}']/bridge_ports none",
|
||||
"set iface[. = '${name}']/bridge_ports none",
|
||||
],
|
||||
notify => Exec["networking-refresh"],
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@ class nova::network::flat (
|
|||
) {
|
||||
|
||||
if $public_interface {
|
||||
nova_config { 'public_interface': value => $public_interface }
|
||||
nova_config { 'DEFAULT/public_interface': value => $public_interface }
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'network_manager': value => 'nova.network.manager.FlatManager';
|
||||
'fixed_range': value => $fixed_range;
|
||||
'flat_interface': value => $flat_interface;
|
||||
'flat_network_bridge': value => $flat_network_bridge;
|
||||
'DEFAULT/network_manager': value => 'nova.network.manager.FlatManager';
|
||||
'DEFAULT/fixed_range': value => $fixed_range;
|
||||
'DEFAULT/flat_interface': value => $flat_interface;
|
||||
'DEFAULT/flat_network_bridge': value => $flat_network_bridge;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,20 +12,20 @@ class nova::network::flatdhcp (
|
|||
) {
|
||||
|
||||
if $public_interface {
|
||||
nova_config { 'public_interface': value => $public_interface }
|
||||
nova_config { 'DEFAULT/public_interface': value => $public_interface }
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'network_manager': value => 'nova.network.manager.FlatDHCPManager';
|
||||
'fixed_range': value => $fixed_range;
|
||||
'flat_interface': value => $flat_interface;
|
||||
'flat_network_bridge': value => $flat_network_bridge;
|
||||
'DEFAULT/network_manager': value => 'nova.network.manager.FlatDHCPManager';
|
||||
'DEFAULT/fixed_range': value => $fixed_range;
|
||||
'DEFAULT/flat_interface': value => $flat_interface;
|
||||
'DEFAULT/flat_network_bridge': value => $flat_network_bridge;
|
||||
#'flat_dhcp_start': value => $flat_dhcp_start;
|
||||
'force_dhcp_release': value => $force_dhcp_release;
|
||||
'flat_injected': value => $flat_injected;
|
||||
'dhcp_domain': value => $dhcp_domain;
|
||||
'dhcpbridge': value => $dhcpbridge;
|
||||
'dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
|
||||
'DEFAULT/force_dhcp_release': value => $force_dhcp_release;
|
||||
'DEFAULT/flat_injected': value => $flat_injected;
|
||||
'DEFAULT/dhcp_domain': value => $dhcp_domain;
|
||||
'DEFAULT/dhcpbridge': value => $dhcpbridge;
|
||||
'DEFAULT/dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,22 +21,22 @@ class nova::network::quantum (
|
|||
) {
|
||||
|
||||
if $public_interface {
|
||||
nova_config { 'public_interface': value => $public_interface }
|
||||
nova_config { 'DEFAULT/public_interface': value => $public_interface }
|
||||
}
|
||||
|
||||
if $quantum_host != 'localhost' {
|
||||
nova_config { 'quantum_connection_host': value => $quantum_connection_host }
|
||||
nova_config { 'DEFAULT/quantum_connection_host': value => $quantum_connection_host }
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'fixed_range': value => $fixed_range;
|
||||
'quantum_use_dhcp': value => $use_dhcp;
|
||||
'quantum_auth_strategy': value => $quantum_auth_strategy;
|
||||
'network_api_class': value => 'nova.network.quantumv2.api.API';
|
||||
'quantum_url': value => $quantum_url;
|
||||
'quantum_admin_tenant_name': value => $quantum_admin_tenant_name;
|
||||
'quantum_admin_username': value => $quantum_admin_username;
|
||||
'quantum_admin_password': value => $quantum_admin_password;
|
||||
'quantum_admin_auth_url': value => $quantum_admin_auth_url;
|
||||
'DEFAULT/fixed_range': value => $fixed_range;
|
||||
'DEFAULT/quantum_use_dhcp': value => $use_dhcp;
|
||||
'DEFAULT/quantum_auth_strategy': value => $quantum_auth_strategy;
|
||||
'DEFAULT/network_api_class': value => 'nova.network.quantumv2.api.API';
|
||||
'DEFAULT/quantum_url': value => $quantum_url;
|
||||
'DEFAULT/quantum_admin_tenant_name': value => $quantum_admin_tenant_name;
|
||||
'DEFAULT/quantum_admin_username': value => $quantum_admin_username;
|
||||
'DEFAULT/quantum_admin_password': value => $quantum_admin_password;
|
||||
'DEFAULT/quantum_admin_auth_url': value => $quantum_admin_auth_url;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,18 +11,18 @@ class nova::network::vlan (
|
|||
) {
|
||||
|
||||
if $public_interface {
|
||||
nova_config { 'public_interface': value => $public_interface }
|
||||
nova_config { 'DEFAULT/public_interface': value => $public_interface }
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'network_manager': value => 'nova.network.manager.VlanManager';
|
||||
'fixed_range': value => $fixed_range;
|
||||
'vlan_interface': value => $vlan_interface;
|
||||
'vlan_start': value => $vlan_start;
|
||||
'force_dhcp_release': value => $force_dhcp_release;
|
||||
'dhcp_domain': value => $dhcp_domain;
|
||||
'dhcpbridge': value => $dhcpbridge;
|
||||
'dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
|
||||
'DEFAULT/network_manager': value => 'nova.network.manager.VlanManager';
|
||||
'DEFAULT/fixed_range': value => $fixed_range;
|
||||
'DEFAULT/vlan_interface': value => $vlan_interface;
|
||||
'DEFAULT/vlan_start': value => $vlan_start;
|
||||
'DEFAULT/force_dhcp_release': value => $force_dhcp_release;
|
||||
'DEFAULT/dhcp_domain': value => $dhcp_domain;
|
||||
'DEFAULT/dhcpbridge': value => $dhcpbridge;
|
||||
'DEFAULT/dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,22 +19,22 @@ class nova::quota(
|
|||
) {
|
||||
|
||||
nova_config {
|
||||
'quota_instances': value => $quota_instances;
|
||||
'quota_cores': value => $quota_cores;
|
||||
'quota_ram': value => $quota_ram;
|
||||
'quota_volumes': value => $quota_volumes;
|
||||
'quota_gigabytes': value => $quota_gigabytes;
|
||||
'quota_floating_ips': value => $quota_floating_ips;
|
||||
'quota_metadata_items': value => $quota_metadata_items;
|
||||
'quota_max_injected_files': value => $quota_max_injected_files;
|
||||
'quota_max_injected_file_content_bytes': value => $quota_max_injected_file_content_bytes;
|
||||
'quota_max_injected_file_path_bytes': value => $quota_max_injected_file_path_bytes;
|
||||
'quota_security_groups': value => $quota_security_groups;
|
||||
'quota_security_group_rules': value => $quota_security_group_rules;
|
||||
'quota_key_pairs': value => $quota_key_pairs;
|
||||
'reservation_expire': value => $reservation_expire;
|
||||
'max_age': value => $max_age;
|
||||
'quota_driver': value => $quota_driver
|
||||
'DEFAULT/quota_instances': value => $quota_instances;
|
||||
'DEFAULT/quota_cores': value => $quota_cores;
|
||||
'DEFAULT/quota_ram': value => $quota_ram;
|
||||
'DEFAULT/quota_volumes': value => $quota_volumes;
|
||||
'DEFAULT/quota_gigabytes': value => $quota_gigabytes;
|
||||
'DEFAULT/quota_floating_ips': value => $quota_floating_ips;
|
||||
'DEFAULT/quota_metadata_items': value => $quota_metadata_items;
|
||||
'DEFAULT/quota_max_injected_files': value => $quota_max_injected_files;
|
||||
'DEFAULT/quota_max_injected_file_content_bytes': value => $quota_max_injected_file_content_bytes;
|
||||
'DEFAULT/quota_max_injected_file_path_bytes': value => $quota_max_injected_file_path_bytes;
|
||||
'DEFAULT/quota_security_groups': value => $quota_security_groups;
|
||||
'DEFAULT/quota_security_group_rules': value => $quota_security_group_rules;
|
||||
'DEFAULT/quota_key_pairs': value => $quota_key_pairs;
|
||||
'DEFAULT/reservation_expire': value => $reservation_expire;
|
||||
'DEFAULT/max_age': value => $max_age;
|
||||
'DEFAULT/quota_driver': value => $quota_driver
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ class nova::vncproxy(
|
|||
# See http://nova.openstack.org/runnova/vncconsole.html for more details.
|
||||
|
||||
nova_config {
|
||||
'novncproxy_host': value => $host;
|
||||
'novncproxy_port': value => $port;
|
||||
'DEFAULT/novncproxy_host': value => $host;
|
||||
'DEFAULT/novncproxy_port': value => $port;
|
||||
}
|
||||
|
||||
package { 'python-numpy':
|
||||
|
|
|
@ -26,10 +26,10 @@ class nova::volume::iscsi (
|
|||
|
||||
include 'nova::params'
|
||||
|
||||
nova_config { 'volume_group': value => $volume_group }
|
||||
nova_config { 'DEFAULT/volume_group': value => $volume_group }
|
||||
|
||||
if $iscsi_ip_address {
|
||||
nova_config { 'iscsi_ip_address': value => $iscsi_ip_address }
|
||||
nova_config { 'DEFAULT/iscsi_ip_address': value => $iscsi_ip_address }
|
||||
}
|
||||
|
||||
case $iscsi_helper {
|
||||
|
@ -46,7 +46,7 @@ class nova::volume::iscsi (
|
|||
require => [Nova::Generic_service['volume'], Package['tgt']],
|
||||
}
|
||||
# This is the default, but might as well be verbose
|
||||
nova_config { 'iscsi_helper': value => 'tgtadm' }
|
||||
nova_config { 'DEFAULT/iscsi_helper': value => 'tgtadm' }
|
||||
}
|
||||
|
||||
'iscsitarget': {
|
||||
|
|
|
@ -20,18 +20,18 @@ class nova::volume::san (
|
|||
) {
|
||||
|
||||
if $san_private_key {
|
||||
nova_config { 'san_private_key': value => $san_private_key }
|
||||
nova_config { 'DEFAULT/san_private_key': value => $san_private_key }
|
||||
} else {
|
||||
nova_config {
|
||||
'san_login': value => $san_login;
|
||||
'san_password': value => $san_password;
|
||||
'DEFAULT/san_login': value => $san_login;
|
||||
'DEFAULT/san_password': value => $san_password;
|
||||
}
|
||||
}
|
||||
|
||||
nova_config {
|
||||
'volume_driver': value => $volume_driver;
|
||||
'san_ip': value => $san_ip;
|
||||
'san_clustername': value => $san_clustername;
|
||||
'DEFAULT/volume_driver': value => $volume_driver;
|
||||
'DEFAULT/san_ip': value => $san_ip;
|
||||
'DEFAULT/san_clustername': value => $san_clustername;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ describe 'nova::api' do
|
|||
should contain_nova_paste_api_ini(
|
||||
'filter:authtoken/admin_password').with_value('passw0rd')
|
||||
end
|
||||
it { should contain_nova_config('ec2_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('osapi_compute_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('metadata_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('osapi_volume_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('DEFAULT/ec2_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('DEFAULT/metadata_listen').with('value' => '0.0.0.0') }
|
||||
it { should contain_nova_config('DEFAULT/osapi_volume_listen').with('value' => '0.0.0.0') }
|
||||
end
|
||||
describe 'with params' do
|
||||
let :params do
|
||||
|
@ -90,10 +90,10 @@ describe 'nova::api' do
|
|||
should contain_nova_paste_api_ini(
|
||||
'filter:authtoken/admin_password').with_value('passw0rd2')
|
||||
end
|
||||
it { should contain_nova_config('ec2_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('osapi_compute_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('metadata_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('osapi_volume_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('DEFAULT/ec2_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('DEFAULT/metadata_listen').with('value' => '192.168.56.210') }
|
||||
it { should contain_nova_config('DEFAULT/osapi_volume_listen').with('value' => '192.168.56.210') }
|
||||
end
|
||||
end
|
||||
describe 'on rhel' do
|
||||
|
|
|
@ -32,10 +32,10 @@ describe 'nova::compute::libvirt' do
|
|||
:before => 'Service[nova-compute]'
|
||||
)}
|
||||
|
||||
it { should contain_nova_config('compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('libvirt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('connection_type').with_value('libvirt')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('127.0.0.1')}
|
||||
it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('DEFAULT/connection_type').with_value('libvirt')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
|
@ -45,8 +45,8 @@ describe 'nova::compute::libvirt' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('libvirt_type').with_value('qemu')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_type').with_value('qemu')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
end
|
||||
|
||||
describe 'with migration_support enabled' do
|
||||
|
@ -58,7 +58,7 @@ describe 'nova::compute::libvirt' do
|
|||
end
|
||||
|
||||
it { should include_class('nova::migration::libvirt')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
end
|
||||
|
||||
context 'with vncserver_listen not set to 0.0.0.0' do
|
||||
|
@ -102,10 +102,10 @@ describe 'nova::compute::libvirt' do
|
|||
:provider => 'init'
|
||||
) }
|
||||
|
||||
it { should contain_nova_config('compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('libvirt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('connection_type').with_value('libvirt')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('127.0.0.1')}
|
||||
it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('DEFAULT/connection_type').with_value('libvirt')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
|
@ -115,8 +115,8 @@ describe 'nova::compute::libvirt' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('libvirt_type').with_value('qemu')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_type').with_value('qemu')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
end
|
||||
|
||||
describe 'with migration_support enabled' do
|
||||
|
@ -128,7 +128,7 @@ describe 'nova::compute::libvirt' do
|
|||
end
|
||||
|
||||
it { should include_class('nova::migration::libvirt')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('0.0.0.0')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('0.0.0.0')}
|
||||
end
|
||||
|
||||
context 'with vncserver_listen not set to 0.0.0.0' do
|
||||
|
@ -162,10 +162,10 @@ describe 'nova::compute::libvirt' do
|
|||
:before => 'Service[nova-compute]'
|
||||
)}
|
||||
|
||||
it { should contain_nova_config('compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('libvirt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('connection_type').with_value('libvirt')}
|
||||
it { should contain_nova_config('vncserver_listen').with_value('127.0.0.1')}
|
||||
it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_type').with_value('kvm')}
|
||||
it { should contain_nova_config('DEFAULT/connection_type').with_value('libvirt')}
|
||||
it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
require 'spec_helper'
|
||||
describe 'nova::compute::quantum' do
|
||||
|
||||
it { should contain_nova_config('libvirt_use_virtio_for_bridges').with_value('True')}
|
||||
it { should contain_nova_config('libvirt_vif_driver').with_value('nova.virt.libvirt.vif.LibvirtOpenVswitchDriver')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_use_virtio_for_bridges').with_value('True')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_vif_driver').with_value('nova.virt.libvirt.vif.LibvirtOpenVswitchDriver')}
|
||||
|
||||
context 'when overriding params' do
|
||||
let :params do
|
||||
{:libvirt_vif_driver => 'foo' }
|
||||
end
|
||||
it { should contain_nova_config('libvirt_vif_driver').with_value('foo')}
|
||||
it { should contain_nova_config('DEFAULT/libvirt_vif_driver').with_value('foo')}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -19,9 +19,9 @@ describe 'nova::compute' do
|
|||
{ :osfamily => 'Debian' }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('vnc_enabled').with_value('true') }
|
||||
it { should contain_nova_config('vncserver_proxyclient_address').with_value('127.0.0.1') }
|
||||
it { should contain_nova_config('novncproxy_base_url').with_value(
|
||||
it { should contain_nova_config('DEFAULT/vnc_enabled').with_value('true') }
|
||||
it { should contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1') }
|
||||
it { should contain_nova_config('DEFAULT/novncproxy_base_url').with_value(
|
||||
'http://127.0.0.1:6080/vnc_auto.html'
|
||||
) }
|
||||
|
||||
|
@ -59,9 +59,9 @@ describe 'nova::compute' do
|
|||
{:vnc_enabled => false}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('vnc_enabled').with_value('false') }
|
||||
it { should contain_nova_config('vncserver_proxyclient_address').with_value('127.0.0.1')}
|
||||
it { should_not contain_nova_config('novncproxy_base_url') }
|
||||
it { should contain_nova_config('DEFAULT/vnc_enabled').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1')}
|
||||
it { should_not contain_nova_config('DEFAULT/novncproxy_base_url') }
|
||||
|
||||
end
|
||||
describe 'with package version' do
|
||||
|
|
|
@ -18,8 +18,8 @@ describe 'nova::consoleauth' do
|
|||
it { should contain_package('nova-consoleauth').with(
|
||||
'ensure' => '2012.1-2'
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,12 +9,12 @@ describe 'nova::db::mysql' do
|
|||
let :facts do
|
||||
{ :osfamily => "Debian" }
|
||||
end
|
||||
|
||||
|
||||
context 'with only required parameters' do
|
||||
let :params do
|
||||
required_params
|
||||
end
|
||||
|
||||
|
||||
it { should contain_mysql__db('nova').with(
|
||||
:user => 'nova',
|
||||
:password => 'qwerty',
|
||||
|
@ -22,12 +22,12 @@ describe 'nova::db::mysql' do
|
|||
:require => "Class[Mysql::Config]"
|
||||
)}
|
||||
end
|
||||
|
||||
|
||||
context 'when overriding charset' do
|
||||
let :params do
|
||||
{ :charset => 'utf8' }.merge(required_params)
|
||||
end
|
||||
|
||||
|
||||
it { should contain_mysql__db('nova').with_charset(params[:charset]) }
|
||||
end
|
||||
end
|
||||
|
@ -36,12 +36,12 @@ describe 'nova::db::mysql' do
|
|||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
|
||||
context 'with only required parameters' do
|
||||
let :params do
|
||||
required_params
|
||||
end
|
||||
|
||||
|
||||
it { should contain_mysql__db('nova').with(
|
||||
:user => 'nova',
|
||||
:password => 'qwerty',
|
||||
|
@ -49,12 +49,12 @@ describe 'nova::db::mysql' do
|
|||
:require => "Class[Mysql::Config]"
|
||||
)}
|
||||
end
|
||||
|
||||
|
||||
context 'when overriding charset' do
|
||||
let :params do
|
||||
{ :charset => 'utf8' }.merge(required_params)
|
||||
end
|
||||
|
||||
|
||||
it { should contain_mysql__db('nova').with_charset(params[:charset]) }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,30 +54,30 @@ describe 'nova' do
|
|||
'refreshonly' => true
|
||||
)}
|
||||
|
||||
it { should_not contain_nova_config('sql_connection') }
|
||||
it { should_not contain_nova_config('DEFAULT/sql_connection') }
|
||||
|
||||
it { should contain_nova_config('image_service').with_value('nova.image.glance.GlanceImageService') }
|
||||
it { should contain_nova_config('glance_api_servers').with_value('localhost:9292') }
|
||||
it { should contain_nova_config('DEFAULT/image_service').with_value('nova.image.glance.GlanceImageService') }
|
||||
it { should contain_nova_config('DEFAULT/glance_api_servers').with_value('localhost:9292') }
|
||||
|
||||
it { should contain_nova_config('auth_strategy').with_value('keystone') }
|
||||
it { should_not contain_nova_config('use_deprecated_auth').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/auth_strategy').with_value('keystone') }
|
||||
it { should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value('false') }
|
||||
|
||||
it { should contain_nova_config('rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
it { should contain_nova_config('rabbit_host').with_value('localhost') }
|
||||
it { should contain_nova_config('rabbit_password').with_value('guest') }
|
||||
it { should contain_nova_config('rabbit_port').with_value('5672') }
|
||||
it { should contain_nova_config('rabbit_hosts').with_value('localhost:5672') }
|
||||
it { should contain_nova_config('rabbit_ha_queues').with_value('false') }
|
||||
it { should contain_nova_config('rabbit_userid').with_value('guest') }
|
||||
it { should contain_nova_config('rabbit_virtual_host').with_value('/') }
|
||||
it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_host').with_value('localhost') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_password').with_value('guest') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_port').with_value('5672') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_hosts').with_value('localhost:5672') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_userid').with_value('guest') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/') }
|
||||
|
||||
it { should contain_nova_config('DEFAULT/verbose').with_value(false) }
|
||||
it { should contain_nova_config('DEFAULT/logdir').with_value('/var/log/nova') }
|
||||
it { should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova') }
|
||||
it { should contain_nova_config('DEFAULT/lock_path').with_value('/var/lock/nova') }
|
||||
it { should contain_nova_config('DEFAULT/service_down_time').with_value('60') }
|
||||
it { should contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf') }
|
||||
|
||||
it { should contain_nova_config('verbose').with_value(false) }
|
||||
it { should contain_nova_config('logdir').with_value('/var/log/nova') }
|
||||
it { should contain_nova_config('state_path').with_value('/var/lib/nova') }
|
||||
it { should contain_nova_config('lock_path').with_value('/var/lock/nova') }
|
||||
it { should contain_nova_config('service_down_time').with_value('60') }
|
||||
it { should contain_nova_config('rootwrap_config').with_value('/etc/nova/rootwrap.conf') }
|
||||
|
||||
|
||||
describe 'with parameters supplied' do
|
||||
|
||||
|
@ -101,27 +101,27 @@ describe 'nova' do
|
|||
|
||||
it { should contain_package('nova-common').with('ensure' => '2012.1.1-15.el6') }
|
||||
it { should contain_package('python-nova').with('ensure' => '2012.1.1-15.el6') }
|
||||
it { should contain_nova_config('sql_connection').with_value('mysql://user:pass@db/db') }
|
||||
it { should contain_nova_config('DEFAULT/sql_connection').with_value('mysql://user:pass@db/db') }
|
||||
|
||||
it { should contain_nova_config('image_service').with_value('nova.image.local.LocalImageService') }
|
||||
it { should_not contain_nova_config('glance_api_servers') }
|
||||
it { should contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService') }
|
||||
it { should_not contain_nova_config('DEFAULT/glance_api_servers') }
|
||||
|
||||
it { should contain_nova_config('auth_strategy').with_value('foo') }
|
||||
it { should_not contain_nova_config('use_deprecated_auth').with_value(true) }
|
||||
it { should contain_nova_config('rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
it { should contain_nova_config('rabbit_host').with_value('rabbit') }
|
||||
it { should contain_nova_config('rabbit_password').with_value('password') }
|
||||
it { should contain_nova_config('rabbit_port').with_value('5673') }
|
||||
it { should contain_nova_config('rabbit_userid').with_value('rabbit_user') }
|
||||
it { should contain_nova_config('rabbit_virtual_host').with_value('/') }
|
||||
it { should contain_nova_config('rabbit_hosts').with_value('rabbit:5673') }
|
||||
it { should contain_nova_config('rabbit_ha_queues').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/auth_strategy').with_value('foo') }
|
||||
it { should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_host').with_value('rabbit') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_password').with_value('password') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_port').with_value('5673') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_userid').with_value('rabbit_user') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_virtual_host').with_value('/') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value('false') }
|
||||
|
||||
it { should contain_nova_config('verbose').with_value(true) }
|
||||
it { should contain_nova_config('logdir').with_value('/var/log/nova2') }
|
||||
it { should contain_nova_config('state_path').with_value('/var/lib/nova2') }
|
||||
it { should contain_nova_config('lock_path').with_value('/var/locky/path') }
|
||||
it { should contain_nova_config('service_down_time').with_value('120') }
|
||||
it { should contain_nova_config('DEFAULT/verbose').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/logdir').with_value('/var/log/nova2') }
|
||||
it { should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova2') }
|
||||
it { should contain_nova_config('DEFAULT/lock_path').with_value('/var/locky/path') }
|
||||
it { should contain_nova_config('DEFAULT/service_down_time').with_value('120') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -133,10 +133,10 @@ describe 'nova' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should_not contain_nova_config('rabbit_host') }
|
||||
it { should_not contain_nova_config('rabbit_port') }
|
||||
it { should contain_nova_config('rabbit_hosts').with_value('rabbit:5673,rabbit2:5674') }
|
||||
it { should contain_nova_config('rabbit_ha_queues').with_value('true') }
|
||||
it { should_not contain_nova_config('DEFAULT/rabbit_host') }
|
||||
it { should_not contain_nova_config('DEFAULT/rabbit_port') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_hosts').with_value('rabbit:5673,rabbit2:5674') }
|
||||
it { should contain_nova_config('DEFAULT/rabbit_ha_queues').with_value('true') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -160,33 +160,33 @@ describe 'nova' do
|
|||
|
||||
it { should contain_package('nova-common').with('ensure' => '2012.1.1-15.el6') }
|
||||
it { should contain_package('python-nova').with('ensure' => '2012.1.1-15.el6') }
|
||||
it { should contain_nova_config('sql_connection').with_value('mysql://user:pass@db/db') }
|
||||
it { should contain_nova_config('DEFAULT/sql_connection').with_value('mysql://user:pass@db/db') }
|
||||
|
||||
it { should contain_nova_config('image_service').with_value('nova.image.local.LocalImageService') }
|
||||
it { should_not contain_nova_config('glance_api_servers') }
|
||||
it { should contain_nova_config('DEFAULT/image_service').with_value('nova.image.local.LocalImageService') }
|
||||
it { should_not contain_nova_config('DEFAULT/glance_api_servers') }
|
||||
|
||||
it { should contain_nova_config('auth_strategy').with_value('foo') }
|
||||
it { should_not contain_nova_config('use_deprecated_auth').with_value(true) }
|
||||
it { should contain_nova_config('rpc_backend').with_value('nova.openstack.common.rpc.impl_qpid') }
|
||||
it { should contain_nova_config('qpid_hostname').with_value('localhost') }
|
||||
it { should contain_nova_config('qpid_port').with_value('5672') }
|
||||
it { should contain_nova_config('qpid_username').with_value('guest') }
|
||||
it { should contain_nova_config('qpid_password').with_value('guest') }
|
||||
it { should contain_nova_config('qpid_reconnect').with_value('true') }
|
||||
it { should contain_nova_config('qpid_reconnect_timeout').with_value('0') }
|
||||
it { should contain_nova_config('qpid_reconnect_limit').with_value('0') }
|
||||
it { should contain_nova_config('qpid_reconnect_interval_min').with_value('0') }
|
||||
it { should contain_nova_config('qpid_reconnect_interval_max').with_value('0') }
|
||||
it { should contain_nova_config('qpid_reconnect_interval').with_value('0') }
|
||||
it { should contain_nova_config('qpid_heartbeat').with_value('60') }
|
||||
it { should contain_nova_config('qpid_protocol').with_value('tcp') }
|
||||
it { should contain_nova_config('qpid_tcp_nodelay').with_value('true') }
|
||||
it { should contain_nova_config('DEFAULT/auth_strategy').with_value('foo') }
|
||||
it { should_not contain_nova_config('DEFAULT/use_deprecated_auth').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_qpid') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_hostname').with_value('localhost') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_port').with_value('5672') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_username').with_value('guest') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_password').with_value('guest') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_reconnect').with_value('true') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_reconnect_timeout').with_value('0') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_reconnect_limit').with_value('0') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_reconnect_interval_min').with_value('0') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_reconnect_interval_max').with_value('0') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_reconnect_interval').with_value('0') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_heartbeat').with_value('60') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_protocol').with_value('tcp') }
|
||||
it { should contain_nova_config('DEFAULT/qpid_tcp_nodelay').with_value('true') }
|
||||
|
||||
it { should contain_nova_config('verbose').with_value(true) }
|
||||
it { should contain_nova_config('logdir').with_value('/var/log/nova2') }
|
||||
it { should contain_nova_config('state_path').with_value('/var/lib/nova2') }
|
||||
it { should contain_nova_config('lock_path').with_value('/var/locky/path') }
|
||||
it { should contain_nova_config('service_down_time').with_value('120') }
|
||||
it { should contain_nova_config('DEFAULT/verbose').with_value(true) }
|
||||
it { should contain_nova_config('DEFAULT/logdir').with_value('/var/log/nova2') }
|
||||
it { should contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova2') }
|
||||
it { should contain_nova_config('DEFAULT/lock_path').with_value('/var/locky/path') }
|
||||
it { should contain_nova_config('DEFAULT/service_down_time').with_value('120') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -198,7 +198,7 @@ describe 'nova' do
|
|||
'name' => 'openstack-nova-common',
|
||||
'ensure' => 'present'
|
||||
)}
|
||||
it { should contain_nova_config('rootwrap_config').with_value('/etc/nova/rootwrap.conf') }
|
||||
it { should contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,11 +10,11 @@ describe 'nova::network::flat' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('network_manager').with_value('nova.network.manager.FlatManager') }
|
||||
it { should_not contain_nova_config('public_interface') }
|
||||
it { should contain_nova_config('fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('flat_network_bridge').with_value('br100') }
|
||||
it { should contain_nova_config('flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatManager') }
|
||||
it { should_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
end
|
||||
|
||||
describe 'when overriding class parameters' do
|
||||
|
@ -28,11 +28,11 @@ describe 'nova::network::flat' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('flat_network_bridge').with_value('br1001') }
|
||||
it { should contain_nova_config('fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -10,16 +10,16 @@ describe 'nova::network::flatdhcp' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('network_manager').with_value('nova.network.manager.FlatDHCPManager') }
|
||||
it { should_not contain_nova_config('public_interface') }
|
||||
it { should contain_nova_config('fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('flat_network_bridge').with_value('br100') }
|
||||
it { should contain_nova_config('force_dhcp_release').with_value('true') }
|
||||
it { should contain_nova_config('flat_injected').with_value('false') }
|
||||
it { should contain_nova_config('dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatDHCPManager') }
|
||||
it { should_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value('true') }
|
||||
it { should contain_nova_config('DEFAULT/flat_injected').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
end
|
||||
|
||||
describe 'when overriding class parameters' do
|
||||
|
@ -33,17 +33,17 @@ describe 'nova::network::flatdhcp' do
|
|||
:force_dhcp_release => false,
|
||||
:flat_injected => true,
|
||||
:dhcpbridge => '/usr/bin/dhcpbridge',
|
||||
:dhcpbridge_flagfile => '/etc/nova/nova-dhcp.conf'
|
||||
:dhcpbridge_flagfile => '/etc/nova/nova-dhcp.conf'
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('flat_network_bridge').with_value('br1001') }
|
||||
it { should contain_nova_config('force_dhcp_release').with_value('false') }
|
||||
it { should contain_nova_config('flat_injected').with_value('true') }
|
||||
it { should contain_nova_config('dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { should contain_nova_config('dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/flat_injected').with_value('true') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -88,7 +88,7 @@ describe 'nova::network' do
|
|||
let :params do
|
||||
default_params.merge(:floating_range => '10.0.0.0/30')
|
||||
end
|
||||
it { should contain_nova_config('floating_range').with_value('10.0.0.0/30') }
|
||||
it { should contain_nova_config('DEFAULT/floating_range').with_value('10.0.0.0/30') }
|
||||
it { should contain_nova__manage__floating('nova-vm-floating').with_network('10.0.0.0/30') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,14 +10,14 @@ describe 'nova::network::vlan' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { should_not contain_nova_config('public_interface') }
|
||||
it { should contain_nova_config('fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('vlan_start').with_value('300') }
|
||||
it { should contain_nova_config('vlan_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('force_dhcp_release').with_value('true') }
|
||||
it { should contain_nova_config('dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { should_not contain_nova_config('DEFAULT/public_interface') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_start').with_value('300') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value('true') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -35,13 +35,13 @@ describe 'nova::network::vlan' do
|
|||
}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { should contain_nova_config('public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('vlan_start').with_value('100') }
|
||||
it { should contain_nova_config('vlan_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('force_dhcp_release').with_value('false') }
|
||||
it { should contain_nova_config('dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { should contain_nova_config('dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
|
||||
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
|
||||
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_start').with_value('100') }
|
||||
it { should contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
|
||||
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value('false') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
|
||||
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
|
||||
describe 'nova::quota' do
|
||||
|
||||
it { should contain_nova_config('quota_ram').with_value('51200') }
|
||||
it { should contain_nova_config('DEFAULT/quota_ram').with_value('51200') }
|
||||
|
||||
describe 'when overriding params' do
|
||||
|
||||
|
@ -10,7 +10,7 @@ describe 'nova::quota' do
|
|||
{:quota_ram => '1'}
|
||||
end
|
||||
|
||||
it { should contain_nova_config('quota_ram').with_value('1') }
|
||||
it { should contain_nova_config('DEFAULT/quota_ram').with_value('1') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ describe 'nova::vncproxy' do
|
|||
:name => 'python-numpy'
|
||||
)}
|
||||
|
||||
it { should contain_nova_config('novncproxy_host').with(:value => '0.0.0.0') }
|
||||
it { should contain_nova_config('novncproxy_port').with(:value => '6080') }
|
||||
it { should contain_nova_config('DEFAULT/novncproxy_host').with(:value => '0.0.0.0') }
|
||||
it { should contain_nova_config('DEFAULT/novncproxy_port').with(:value => '6080') }
|
||||
|
||||
it { should contain_package('nova-vncproxy').with(
|
||||
:name => ["novnc", "nova-novncproxy"],
|
||||
|
|
|
@ -39,8 +39,8 @@ describe 'nova::volume::iscsi' do
|
|||
it { should contain_file('/etc/default/iscsitarget') }
|
||||
end
|
||||
|
||||
it { should contain_nova_config('volume_group').with_value('nova-volumes') }
|
||||
it { should_not contain_nova_config('iscsi_ip_address') }
|
||||
it { should contain_nova_config('DEFAULT/volume_group').with_value('nova-volumes') }
|
||||
it { should_not contain_nova_config('DEFAULT/iscsi_ip_address') }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ describe provider_class do
|
|||
|
||||
it 'should default to the default setting when no other one is specified' do
|
||||
resource = Puppet::Type::Nova_config.new(
|
||||
{:name => 'foo', :value => 'bar'}
|
||||
{:name => 'DEFAULT/foo', :value => 'bar'}
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
provider.section.should == 'DEFAULT'
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'puppet'
|
|||
require 'puppet/type/nova_config'
|
||||
describe 'Puppet::Type.type(:nova_config)' do
|
||||
before :each do
|
||||
@nova_config = Puppet::Type.type(:nova_config).new(:name => 'foo', :value => 'bar')
|
||||
@nova_config = Puppet::Type.type(:nova_config).new(:name => 'DEFAULT/foo', :value => 'bar')
|
||||
end
|
||||
it 'should require a name' do
|
||||
expect {
|
||||
|
@ -12,14 +12,19 @@ describe 'Puppet::Type.type(:nova_config)' do
|
|||
it 'should not expect a name with whitespace' do
|
||||
expect {
|
||||
Puppet::Type.type(:nova_config).new(:name => 'f oo')
|
||||
}.to raise_error(Puppet::Error, /Invalid value/)
|
||||
}.to raise_error(Puppet::Error, /Invalid nova_config/)
|
||||
end
|
||||
it 'should fail when there is no section' do
|
||||
expect {
|
||||
Puppet::Type.type(:nova_config).new(:name => 'foo')
|
||||
}.to raise_error(Puppet::Error, /entries without sections are no longer supported/)
|
||||
end
|
||||
it 'should not require a value when ensure is absent' do
|
||||
Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :absent)
|
||||
Puppet::Type.type(:nova_config).new(:name => 'DEFAULT/foo', :ensure => :absent)
|
||||
end
|
||||
it 'should require a value when ensure is present' do
|
||||
expect {
|
||||
Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :present)
|
||||
Puppet::Type.type(:nova_config).new(:name => 'DEFAULT/foo', :ensure => :present)
|
||||
}.to raise_error(Puppet::Error, /Property value must be set/)
|
||||
end
|
||||
it 'should accept a valid value' do
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
class { 'nova':
|
||||
class { 'nova':
|
||||
sql_connection => 'mysql://root:<password>@127.0.0.1/nova',
|
||||
}
|
||||
class { 'mysql::server':
|
||||
root_password => 'password'
|
||||
root_password => 'password'
|
||||
}
|
||||
class { 'nova::db':
|
||||
password => 'password',
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
resources { 'nova_config':
|
||||
purge => true
|
||||
}
|
||||
nova_config { ['verbose', 'nodaemomize']:
|
||||
nova_config { ['DEFAULT/verbose', 'DEFAULT/nodaemomize']:
|
||||
value => 'true',
|
||||
}
|
||||
nova_config { 'xenapi_connection_username':
|
||||
nova_config { 'DEFAULT/xenapi_connection_username':
|
||||
value => 'rootty',
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ This test should configure everything needed to run openstack on a compute vm ru
|
|||
on a xenserver.
|
||||
*/
|
||||
|
||||
Nova_config { target => '/etc/nova/nova.conf' }
|
||||
resources { 'nova_config':
|
||||
purge => true,
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class { 'nova': }
|
||||
|
||||
class { 'nova::volume':
|
||||
class { 'nova::volume':
|
||||
enabled => true,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue