Skip to content

Commit 772ebc0

Browse files
committed
Merge pull request #167 from bodepd/folsom_master
Folsom master
2 parents 88650b1 + 03d7c21 commit 772ebc0

File tree

6 files changed

+114
-11
lines changed

6 files changed

+114
-11
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
* 2012-10-08 0.2.2
2+
- various improvements for testing
3+
- Adds support for system usage data notifications via rabbitmq driver
4+
- Parameterize the nova db charset
5+
- Add dhcp_domain to vlan manifest and flatdhcp
6+
- Adds basic quantum support
7+
- support Redhat
8+
- make bind address customizable
19
* 2012-06-12 0.1.1
210
- Fix dependency for automatic forge installation
311

Modulefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ description 'Puppet module to install and configure the OpenStack Nova compute s
88
project_page 'https://github.com/puppetlabs/puppetlabs-nova'
99

1010
## Add dependencies, if any:
11-
dependency 'puppetlabs/apt', '>= 0.0.3'
11+
dependency 'puppetlabs/apt', '>= 0.0.4'
1212
dependency 'puppetlabs/glance', '>= 0.2.0'
1313
dependency 'puppetlabs/keystone', '>= 0.2.0'
14-
dependency 'puppetlabs/mysql', '>= 0.3.0'
15-
dependency 'puppetlabs/rabbitmq', '>= 2.0.0'
16-
dependency 'puppetlabs/stdlib', '>= 2.3.0'
14+
dependency 'puppetlabs/mysql', '>= 0.5.0'
15+
dependency 'puppetlabs/rabbitmq', '>= 2.0.2'
16+
dependency 'puppetlabs/stdlib', '>= 2.4.0'
1717
dependency 'duritong/sysctl', '>= 0.0.1'

manifests/api.pp

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
$auth_protocol = 'http',
2323
$admin_tenant_name = 'services',
2424
$admin_user = 'nova',
25-
$enabled_apis = 'ec2,osapi_compute,metadata'
25+
$admin_password = 'passw0rd',
26+
$api_bind_address = '0.0.0.0',
27+
$enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata'
2628
) {
2729

2830
include nova::params
@@ -41,9 +43,13 @@
4143
}
4244

4345
nova_config {
44-
'api_paste_config': value => '/etc/nova/api-paste.ini';
45-
'enabled_apis': value => $enabled_apis;
46-
'volume_api_class': value => 'nova.volume.cinder.API';
46+
'api_paste_config': value => '/etc/nova/api-paste.ini';
47+
'enabled_apis': value => $enabled_apis;
48+
'volume_api_class': value => 'nova.volume.cinder.API';
49+
'ec2_listen': value => $api_bind_address;
50+
'osapi_compute_listen': value => $api_bind_address;
51+
'metadata_listen': value => $api_bind_address;
52+
'osapi_volume_listen': value => $api_bind_address;
4753
}
4854

4955
nova_paste_api_ini {
@@ -55,6 +61,26 @@
5561
'filter:authtoken/admin_password': value => $admin_password;
5662
}
5763

64+
if 'occiapi' in $enabled_apis {
65+
if !defined(Package['python-pip']) {
66+
package {'python-pip':
67+
ensure => latest,
68+
}
69+
}
70+
if !defined(Package['pyssf']){
71+
package {'pyssf':
72+
provider => pip,
73+
ensure => latest,
74+
require => Package['python-pip']
75+
}
76+
}
77+
package { 'openstackocci' :
78+
provider => 'pip',
79+
ensure => latest,
80+
require => Package['python-pip'],
81+
}
82+
}
83+
5884
# I need to ensure that I better understand this resource
5985
# this is potentially constantly resyncing a central DB
6086
exec { "nova-db-sync":

manifests/compute/libvirt.pp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class nova::compute::libvirt (
2-
$libvirt_type = 'kvm',
3-
$vncserver_listen = '127.0.0.1'
2+
$libvirt_type = 'kvm',
3+
$vncserver_listen = '127.0.0.1',
4+
$migration_support = false
45
) {
56

67
include nova::params
@@ -41,4 +42,12 @@
4142
'connection_type': value => 'libvirt';
4243
'vncserver_listen': value => $vncserver_listen;
4344
}
45+
46+
if $migration_support {
47+
if $vncserver_listen != '0.0.0.0' {
48+
fail("For migration support to work, you MUST set vncserver_listen to '0.0.0.0'")
49+
} else {
50+
class { 'nova::migration::libvirt': }
51+
}
52+
}
4453
}

manifests/migration/libvirt.pp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
class nova::migration::libvirt {
2+
3+
define replace($file, $orig, $new) {
4+
exec { "Replace ${orig} with ${new} in ${file}":
5+
path => ['/bin', '/usr/bin'],
6+
command => "perl -p -i -e 's/^${orig}\$/${new}/g' ${file}",
7+
unless => "grep -q '^${new}$' ${file}",
8+
notify => Service['libvirt'],
9+
}
10+
}
11+
12+
case $::lsbdistid {
13+
'Ubuntu': {
14+
# Ubuntu-specific, not Debian, due to upstart
15+
16+
file_line { '/etc/libvirt/libvirtd.conf listen_tls':
17+
path => '/etc/libvirt/libvirtd.conf',
18+
line => 'listen_tls = 0',
19+
match => 'listen_tls =',
20+
notify => Service['libvirt'],
21+
}
22+
23+
file_line { '/etc/libvirt/libvirtd.conf listen_tcp':
24+
path => '/etc/libvirt/libvirtd.conf',
25+
line => 'listen_tcp = 1',
26+
match => 'listen_tcp =',
27+
notify => Service['libvirt'],
28+
}
29+
30+
file_line { '/etc/libvirt/libvirtd.conf auth_tcp':
31+
path => '/etc/libvirt/libvirtd.conf',
32+
line => 'auth_tcp = "none"',
33+
match => 'auth_tcp =',
34+
notify => Service['libvirt'],
35+
}
36+
37+
file_line { '/etc/init/libvirt-bin.conf libvirtd opts':
38+
path => '/etc/init/libvirt-bin.conf',
39+
line => 'env libvirtd_opts="-d -l"',
40+
match => 'env libvirtd_opts=',
41+
}
42+
43+
file_line { '/etc/default/libvirt-bin libvirtd opts':
44+
path => '/etc/default/libvirt-bin',
45+
line => 'libvirtd_opts="-d -l"',
46+
match => 'libvirtd_opts=',
47+
}
48+
49+
}
50+
}
51+
}

spec/classes/nova_api_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
should contain_nova_paste_api_ini(
5858
'filter:authtoken/admin_password').with_value('passw0rd')
5959
end
60+
it { should contain_nova_config('ec2_listen').with('value' => '0.0.0.0') }
61+
it { should contain_nova_config('osapi_compute_listen').with('value' => '0.0.0.0') }
62+
it { should contain_nova_config('metadata_listen').with('value' => '0.0.0.0') }
63+
it { should contain_nova_config('osapi_volume_listen').with('value' => '0.0.0.0') }
6064
end
6165
describe 'with params' do
6266
let :params do
@@ -67,7 +71,8 @@
6771
:auth_protocol => 'https',
6872
:admin_tenant_name => 'service2',
6973
:admin_user => 'nova2',
70-
:admin_password => 'passw0rd2'
74+
:admin_password => 'passw0rd2',
75+
:api_bind_address => '192.168.56.210',
7176
}
7277
end
7378
it 'should use default params for api-paste.init' do
@@ -84,6 +89,10 @@
8489
should contain_nova_paste_api_ini(
8590
'filter:authtoken/admin_password').with_value('passw0rd2')
8691
end
92+
it { should contain_nova_config('ec2_listen').with('value' => '192.168.56.210') }
93+
it { should contain_nova_config('osapi_compute_listen').with('value' => '192.168.56.210') }
94+
it { should contain_nova_config('metadata_listen').with('value' => '192.168.56.210') }
95+
it { should contain_nova_config('osapi_volume_listen').with('value' => '192.168.56.210') }
8796
end
8897
end
8998
describe 'on rhel' do

0 commit comments

Comments
 (0)