diff --git a/CHANGELOG b/CHANGELOG index 8035b107..ce6675c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/Modulefile b/Modulefile index 5d009605..0f2fd4d3 100644 --- a/Modulefile +++ b/Modulefile @@ -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' diff --git a/manifests/api.pp b/manifests/api.pp index f6776393..a3e093c3 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -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 @@ -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 { @@ -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": diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 07d5f9b3..3b24133d 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -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 @@ -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': } + } + } } diff --git a/manifests/migration/libvirt.pp b/manifests/migration/libvirt.pp new file mode 100644 index 00000000..97c56acc --- /dev/null +++ b/manifests/migration/libvirt.pp @@ -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=', + } + + } + } +} diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index 9e6d8f61..bb98a5e5 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -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 @@ -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 @@ -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