Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into HEAD
Browse files Browse the repository at this point in the history
Conflicts:
	Modulefile
	manifests/api.pp
	manifests/compute/libvirt.pp
	spec/classes/nova_api_spec.rb
	templates/api-paste.ini.erb

resolving conflicts between master and folsom branches
  • Loading branch information
Dan Bode committed Oct 24, 2012
2 parents 88650b1 + 6e899cd commit 03d7c21
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
* 2012-10-08 0.2.2
- various improvements for testing
- Adds support for system usage data notifications via rabbitmq driver
- Parameterize the nova db charset
- Add dhcp_domain to vlan manifest and flatdhcp
- Adds basic quantum support
- support Redhat
- make bind address customizable
* 2012-06-12 0.1.1
- Fix dependency for automatic forge installation

Expand Down
8 changes: 4 additions & 4 deletions Modulefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ description 'Puppet module to install and configure the OpenStack Nova compute s
project_page 'https://github.com/puppetlabs/puppetlabs-nova'

## Add dependencies, if any:
dependency 'puppetlabs/apt', '>= 0.0.3'
dependency 'puppetlabs/apt', '>= 0.0.4'
dependency 'puppetlabs/glance', '>= 0.2.0'
dependency 'puppetlabs/keystone', '>= 0.2.0'
dependency 'puppetlabs/mysql', '>= 0.3.0'
dependency 'puppetlabs/rabbitmq', '>= 2.0.0'
dependency 'puppetlabs/stdlib', '>= 2.3.0'
dependency 'puppetlabs/mysql', '>= 0.5.0'
dependency 'puppetlabs/rabbitmq', '>= 2.0.2'
dependency 'puppetlabs/stdlib', '>= 2.4.0'
dependency 'duritong/sysctl', '>= 0.0.1'
34 changes: 30 additions & 4 deletions manifests/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
$auth_protocol = 'http',
$admin_tenant_name = 'services',
$admin_user = 'nova',
$enabled_apis = 'ec2,osapi_compute,metadata'
$admin_password = 'passw0rd',
$api_bind_address = '0.0.0.0',
$enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata'
) {

include nova::params
Expand All @@ -41,9 +43,13 @@
}

nova_config {
'api_paste_config': value => '/etc/nova/api-paste.ini';
'enabled_apis': value => $enabled_apis;
'volume_api_class': value => 'nova.volume.cinder.API';
'api_paste_config': value => '/etc/nova/api-paste.ini';
'enabled_apis': value => $enabled_apis;
'volume_api_class': value => 'nova.volume.cinder.API';
'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;
}

nova_paste_api_ini {
Expand All @@ -55,6 +61,26 @@
'filter:authtoken/admin_password': value => $admin_password;
}

if 'occiapi' in $enabled_apis {
if !defined(Package['python-pip']) {
package {'python-pip':
ensure => latest,
}
}
if !defined(Package['pyssf']){
package {'pyssf':
provider => pip,
ensure => latest,
require => Package['python-pip']
}
}
package { 'openstackocci' :
provider => 'pip',
ensure => latest,
require => Package['python-pip'],
}
}

# I need to ensure that I better understand this resource
# this is potentially constantly resyncing a central DB
exec { "nova-db-sync":
Expand Down
13 changes: 11 additions & 2 deletions manifests/compute/libvirt.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class nova::compute::libvirt (
$libvirt_type = 'kvm',
$vncserver_listen = '127.0.0.1'
$libvirt_type = 'kvm',
$vncserver_listen = '127.0.0.1',
$migration_support = false
) {

include nova::params
Expand Down Expand Up @@ -41,4 +42,12 @@
'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': }
}
}
}
51 changes: 51 additions & 0 deletions manifests/migration/libvirt.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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

file_line { '/etc/libvirt/libvirtd.conf listen_tls':
path => '/etc/libvirt/libvirtd.conf',
line => 'listen_tls = 0',
match => 'listen_tls =',
notify => Service['libvirt'],
}

file_line { '/etc/libvirt/libvirtd.conf listen_tcp':
path => '/etc/libvirt/libvirtd.conf',
line => 'listen_tcp = 1',
match => 'listen_tcp =',
notify => Service['libvirt'],
}

file_line { '/etc/libvirt/libvirtd.conf auth_tcp':
path => '/etc/libvirt/libvirtd.conf',
line => 'auth_tcp = "none"',
match => 'auth_tcp =',
notify => Service['libvirt'],
}

file_line { '/etc/init/libvirt-bin.conf libvirtd opts':
path => '/etc/init/libvirt-bin.conf',
line => 'env libvirtd_opts="-d -l"',
match => 'env libvirtd_opts=',
}

file_line { '/etc/default/libvirt-bin libvirtd opts':
path => '/etc/default/libvirt-bin',
line => 'libvirtd_opts="-d -l"',
match => 'libvirtd_opts=',
}

}
}
}
11 changes: 10 additions & 1 deletion spec/classes/nova_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
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') }
end
describe 'with params' do
let :params do
Expand All @@ -67,7 +71,8 @@
:auth_protocol => 'https',
:admin_tenant_name => 'service2',
:admin_user => 'nova2',
:admin_password => 'passw0rd2'
:admin_password => 'passw0rd2',
:api_bind_address => '192.168.56.210',
}
end
it 'should use default params for api-paste.init' do
Expand All @@ -84,6 +89,10 @@
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') }
end
end
describe 'on rhel' do
Expand Down

0 comments on commit 03d7c21

Please sign in to comment.