Add Ironic support into nova puppet modules

Ironic needs to make some additions to the nova config
file in order to run.  The remaining configuraitons will
be added to the nova plugin in packstack.

Change-Id: I34c7c8a6001b0433aee9017ac571e3bd4f2f02b2
This commit is contained in:
Ryan Hallisey 2014-12-09 11:22:05 -05:00
parent e5934ce389
commit 5a9ac69f4c
4 changed files with 85 additions and 0 deletions

View File

@ -73,6 +73,16 @@
# (optional) Force backing images to raw format.
# Defaults to true
#
# [*reserved_host_memory*]
# Reserved host memory
# The amount of memory in MB reserved for the host.
# Defaults to '0'
#
# [*compute_manager*]
# Compute manager
# The manager for nova compute.
# Defaults to nova.compute.manager.ComputeManager
#
class nova::compute (
$enabled = false,
$manage_service = true,
@ -91,10 +101,17 @@ class nova::compute (
$instance_usage_audit = false,
$instance_usage_audit_period = 'month',
$force_raw_images = true,
$reserved_host_memory = '0',
$compute_manager = 'nova.compute.manager.ComputeManager',
) {
include nova::params
nova_config {
'DEFAULT/reserved_host_memory_mb': value => $reserved_host_memory;
'DEFAULT/compute_manager': value => $compute_manager;
}
if ($vnc_enabled) {
if ($vncproxy_host) {
$vncproxy_base_url = "${vncproxy_protocol}://${vncproxy_host}:${vncproxy_port}${vncproxy_path}"

View File

@ -0,0 +1,49 @@
# == Class: nova::compute::ironic
#
# Configures Nova compute service to use Ironic.
#
# === Parameters:
#
# [*admin_user*]
# Admin username
# The admin username for Ironic to connect to Nova.
# Defaults to 'admin'
#
# [*admin_passwd*]
# Admin password
# The admin password for Ironic to connect to Nova.
# Defaults to 'ironic'
#
# [*admin_url*]
# Admin url
# The address of the Keystone api endpoint.
# Defaults to 'http://127.0.0.1:35357/v2.0'
#
# [*admin_tenant_name*]
# Admin tenant name
# The Ironic Keystone tenant name.
# Defaults to 'services'
#
# [*api_endpoint*]
# Api endpoint
# The url for Ironic api endpoint.
# Defaults to 'http://127.0.0.1:6385/v1'
#
class nova::compute::ironic (
$admin_user = 'admin',
$admin_passwd = 'ironic',
$admin_url = 'http://127.0.0.1:35357/v2.0',
$admin_tenant_name = 'services',
$api_endpoint = 'http://127.0.0.1:6385/v1',
) {
nova_config {
'ironic/admin_username': value => $admin_user;
'ironic/admin_password': value => $admin_passwd;
'ironic/admin_url': value => $admin_url;
'ironic/admin_tenant_name': value => $admin_tenant_name;
'ironic/api_endpoint': value => $api_endpoint;
'DEFAULT/compute_driver': value => 'nova.virt.ironic.IronicDriver';
}
}

View File

@ -0,0 +1,13 @@
require 'spec_helper'
describe 'nova::compute::ironic' do
it 'configures ironic in nova.conf' do
should contain_nova_config('ironic/admin_username').with_value('admin')
should contain_nova_config('ironic/admin_password').with_value('ironic')
should contain_nova_config('ironic/admin_url').with_value('http://127.0.0.1:35357/v2.0')
should contain_nova_config('ironic/admin_tenant_name').with_value('services')
should contain_nova_config('ironic/api_endpoint').with_value('http://127.0.0.1:6385/v1')
should contain_nova_config('DEFAULT/compute_driver').with_value('nova.virt.ironic.IronicDriver')
end
end

View File

@ -61,6 +61,12 @@ describe 'nova::compute' do
})
end
it 'configures ironic in nova.conf' do
should contain_nova_config('DEFAULT/reserved_host_memory_mb').with_value('0')
should contain_nova_config('DEFAULT/compute_manager').with_value('nova.compute.manager.ComputeManager')
end
it 'configures network_device_mtu' do
should contain_nova_config('DEFAULT/network_device_mtu').with_value('9999')
end