Merge pull request #195 from puppetlabs/master

merge folsom changes from master
This commit is contained in:
Dan Bode 2012-11-13 23:51:29 -08:00
commit 8e15bf943c
7 changed files with 45 additions and 31 deletions

View File

@ -28,10 +28,13 @@ class nova::api(
) {
include nova::params
require keystone::python
Package<| title == 'nova-api' |> -> Exec['nova-db-sync']
Package<| title == 'nova-api' |> -> Nova_paste_api_ini<| |>
Package<| title == 'nova-common' |> -> Class['nova::api']
Nova_paste_api_ini<| |> ~> Exec['post-nova_config']
Nova_paste_api_ini<| |> ~> Service['nova-api']

View File

@ -15,6 +15,14 @@ class nova::compute::libvirt (
}
}
if $migration_support {
if $vncserver_listen != '0.0.0.0' {
fail("For migration support to work, you MUST set vncserver_listen to '0.0.0.0'")
} else {
class { 'nova::migration::libvirt': }
}
}
package { 'libvirt':
name => $::nova::params::libvirt_package_name,
ensure => present,
@ -33,12 +41,4 @@ class nova::compute::libvirt (
'connection_type': value => 'libvirt';
'vncserver_listen': value => $vncserver_listen;
}
if $migration_support {
if $vncserver_listen != '0.0.0.0' {
fail("For migration support to work, you MUST set vncserver_listen to '0.0.0.0'")
} else {
class { 'nova::migration::libvirt': }
}
}
}

View File

@ -11,7 +11,8 @@ class nova::keystone::auth(
$volume_version = 'v1',
$region = 'RegionOne',
$tenant = 'services',
$email = 'nova@localhost'
$email = 'nova@localhost',
$cinder = false
) {
keystone_user { $auth_name:
@ -36,16 +37,18 @@ class nova::keystone::auth(
internal_url => "http://${internal_address}:${compute_port}/${compute_version}/%(tenant_id)s",
}
keystone_service { "${auth_name}_volume":
ensure => present,
type => 'volume',
description => 'Volume Service',
}
keystone_endpoint { "${region}/${auth_name}_volume":
ensure => present,
public_url => "http://${public_address}:${volume_port}/${volume_version}/%(tenant_id)s",
admin_url => "http://${admin_address}:${volume_port}/${volume_version}/%(tenant_id)s",
internal_url => "http://${internal_address}:${volume_port}/${volume_version}/%(tenant_id)s",
if $cinder == false {
keystone_service { "${auth_name}_volume":
ensure => present,
type => 'volume',
description => 'Volume Service',
}
keystone_endpoint { "${region}/${auth_name}_volume":
ensure => present,
public_url => "http://${public_address}:${volume_port}/${volume_version}/%(tenant_id)s",
admin_url => "http://${admin_address}:${volume_port}/${volume_version}/%(tenant_id)s",
internal_url => "http://${internal_address}:${volume_port}/${volume_version}/%(tenant_id)s",
}
}
keystone_service { "${auth_name}_ec2":

View File

@ -9,7 +9,8 @@ define nova::manage::network (
$network,
$num_networks = 1,
$network_size = 255,
$project = undef
$vlan_start = undef,
$project = undef
) {
File['/etc/nova/nova.conf'] -> Nova_network[$name]
@ -21,6 +22,7 @@ define nova::manage::network (
num_networks => $num_networks,
network_size => $network_size,
project => $project,
vlan_start => $vlan_start,
}
}

View File

@ -1,14 +1,5 @@
class nova::migration::libvirt {
define replace($file, $orig, $new) {
exec { "Replace ${orig} with ${new} in ${file}":
path => ['/bin', '/usr/bin'],
command => "perl -p -i -e 's/^${orig}\$/${new}/g' ${file}",
unless => "grep -q '^${new}$' ${file}",
notify => Service['libvirt'],
}
}
case $::lsbdistid {
'Ubuntu': {
# Ubuntu-specific, not Debian, due to upstart

View File

@ -43,6 +43,12 @@ class nova::network(
nova_config { 'floating_range': value => $floating_range }
}
if has_key($config_overrides, 'vlan_start') {
$vlan_start = $config_overrides['vlan_start']
} else {
$vlan_start = undef
}
if $install_service {
nova::generic_service { 'network':
enabled => $enabled,
@ -58,6 +64,7 @@ class nova::network(
network => $fixed_range,
num_networks => $num_networks,
network_size => $network_size,
vlan_start => $vlan_start,
}
if $floating_range {
nova::manage::floating { 'nova-vm-floating':

View File

@ -1,6 +1,14 @@
# unzip swig screen parted curl euca2ools - extra packages
class nova::utilities {
package { ['unzip', 'screen', 'parted', 'curl', 'euca2ools']:
ensure => present
define nova::utilities::install(){
if !defined(Package[$title]){
package { $title:
ensure => present
}
}
}
if $::osfamily == 'Debian' {
$pkgs=['unzip', 'screen', 'parted', 'curl', 'euca2ools']
nova::utilities::install{$pkgs:}
}
}