Skip to content

Commit

Permalink
Merge pull request #170 from bodepd/folsom_master
Browse files Browse the repository at this point in the history
Folsom master
  • Loading branch information
bodepd committed Oct 25, 2012
2 parents 6e899cd + 69746d0 commit 10b57ad
Show file tree
Hide file tree
Showing 44 changed files with 291 additions and 562 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ fixtures:
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
"sysctl": "git://github.com/duritong/puppet-sysctl.git"
"rabbitmq": "git://github.com/puppetlabs/puppetlabs-rabbitmq.git"
'inifile': 'git://github.com/cprice-puppet/puppetlabs-inifile'
symlinks:
"nova": "#{source_dir}"
12 changes: 6 additions & 6 deletions examples/all.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
class { 'keystone':
admin_token => $keystone_admin_token,
bind_host => '127.0.0.1',
log_verbose => true,
log_debug => true,
verbose => true,
debug => true,
catalog_type => 'sql',
}
# set up keystone admin users
Expand All @@ -97,8 +97,8 @@
}

class { 'glance::api':
log_verbose => 'True',
log_debug => 'True',
verbose => 'True',
debug => 'True',
auth_type => 'keystone',
auth_host => '127.0.0.1',
auth_port => '35357',
Expand All @@ -109,8 +109,8 @@
class { 'glance::backend::file': }

class { 'glance::registry':
log_verbose => 'True',
log_debug => 'True',
verbose => 'True',
debug => 'True',
auth_type => 'keystone',
auth_host => '127.0.0.1',
auth_port => '35357',
Expand Down
12 changes: 6 additions & 6 deletions examples/multi.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
class { 'keystone':
admin_token => $keystone_admin_token,
bind_host => '127.0.0.1',
log_verbose => true,
log_debug => true,
verbose => true,
debug => true,
catalog_type => 'sql',
}
# set up keystone admin users
Expand All @@ -117,8 +117,8 @@
}

class { 'glance::api':
log_verbose => 'True',
log_debug => 'True',
verbose => 'True',
debug => 'True',
auth_type => 'keystone',
auth_host => '127.0.0.1',
auth_port => '35357',
Expand All @@ -129,8 +129,8 @@
class { 'glance::backend::file': }

class { 'glance::registry':
log_verbose => 'True',
log_debug => 'True',
verbose => 'True',
debug => 'True',
auth_type => 'keystone',
auth_host => '127.0.0.1',
auth_port => '35357',
Expand Down
4 changes: 2 additions & 2 deletions examples/site.pp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
password => 'keystone'
}
class { 'keystone':
log_verbose => true,
log_debug => true,
verbose => true,
debug => true,
catalog_type => 'sql',
}->
class { 'keystone::mysql':
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/nova_config/parsed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
:filetype => :flat
) do

confine :osfamily => [:debian]

#confine :exists => novaconf
text_line :comment, :match => /^\s*#/;
Expand Down
3 changes: 2 additions & 1 deletion lib/puppet/provider/nova_config/parsed_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
:filetype => :flat
) do

confine :osfamily => [:redhat]
confine :osfamily => [:debian, :redhat]
defaultfor :operatingsystem => :debian

#confine :exists => novaconf
text_line :comment, :match => /#|\[.*/;
Expand Down
7 changes: 4 additions & 3 deletions lib/puppet/provider/nova_network/nova_manage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def create
end

nova_manage('network', 'create',
"--label=#{resource[:label]}",
"--fixed_range_v4=#{resource[:name]}",
"--num_networks=#{resource[:num_networks]}",
resource[:label],
resource[:name],
resource[:num_networks],
resource[:network_size],
optional_opts
)
end
Expand Down
22 changes: 22 additions & 0 deletions lib/puppet/provider/nova_paste_api_ini/ini_setting.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Puppet::Type.type(:nova_paste_api_ini).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do

def section
resource[:name].split('/', 2).first
end

def setting
resource[:name].split('/', 2).last
end

def separator
'='
end

def file_path
'/etc/nova/api-paste.ini'
end

end
6 changes: 3 additions & 3 deletions lib/puppet/type/nova_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
desc 'project that the network is associated with'
end

# we are not currently using this stuff
newparam(:gateway) do

end

newparam(:dns2) do

end

newparam(:vlan_start) do
end

newparam(:network_size) do
defaultto('256')
end

validate do
Expand Down
18 changes: 18 additions & 0 deletions lib/puppet/type/nova_paste_api_ini.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Puppet::Type.newtype(:nova_paste_api_ini) do

ensurable

newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from nova/paste-api.ini'
newvalues(/\S+\/\S+/)
end

newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |v|
v.to_s.strip
end
end


end
70 changes: 45 additions & 25 deletions manifests/api.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#
# installs and configures nova api service
#
# * admin_password
# * enabled
# * ensure_package
# * auth_strategy
# * auth_host
# * auth_port
# * auth_protocol
# * admin_tenant_name
# * admin_user
# * enabled_apis
#
class nova::api(
$admin_password,
$enabled = false,
$ensure_package = 'present',
$auth_strategy = 'keystone',
Expand All @@ -9,22 +24,16 @@
$admin_user = 'nova',
$admin_password = 'passw0rd',
$api_bind_address = '0.0.0.0',
$enabled_apis = 'ec2,osapi_compute,osapi_volume,metadata'
$enabled_apis = 'ec2,osapi_compute,metadata'
) {

include nova::params

$auth_uri = "${auth_protocol}://${auth_host}:${auth_port}/v2.0"

exec { 'initial-db-sync':
command => '/usr/bin/nova-manage db sync',
refreshonly => true,
require => [Package[$::nova::params::common_package_name], Nova_config['sql_connection']],
}

Package<| title == 'nova-api' |> -> Exec['initial-db-sync']
Package<| title == 'nova-api' |> -> File['/etc/nova/api-paste.ini']
Package<| title == 'nova-api' |> -> Exec['nova-db-sync']
Package<| title == 'nova-api' |> -> Nova_paste_api_ini<| |>

Nova_paste_api_ini<| |> ~> Exec['post-nova_config']
Nova_paste_api_ini<| |> ~> Service['nova-api']

nova::generic_service { 'api':
enabled => $enabled,
Expand All @@ -33,6 +42,25 @@
service_name => $::nova::params::api_service_name,
}

nova_config {
'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 {
'filter:authtoken/auth_host': value => $auth_host;
'filter:authtoken/auth_port': value => $auth_port;
'filter:authtoken/auth_protocol': value => $auth_protocol;
'filter:authtoken/admin_tenant_name': value => $admin_tenant_name;
'filter:authtoken/admin_user': value => $admin_user;
'filter:authtoken/admin_password': value => $admin_password;
}

if 'occiapi' in $enabled_apis {
if !defined(Package['python-pip']) {
package {'python-pip':
Expand All @@ -53,20 +81,12 @@
}
}

nova_config { 'enabled_apis': value => $enabled_apis; }

nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; }

nova_config {
'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;
# I need to ensure that I better understand this resource
# this is potentially constantly resyncing a central DB
exec { "nova-db-sync":
command => "/usr/bin/nova-manage db sync",
refreshonly => "true",
subscribe => Exec['post-nova_config'],
}

file { '/etc/nova/api-paste.ini':
content => template('nova/api-paste.ini.erb'),
require => Class['nova'],
notify => Service['nova-api'],
}
}
3 changes: 3 additions & 0 deletions manifests/cert.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#
# installs nova cert package and service
#
class nova::cert(
$enabled = false,
$ensure_package = 'present'
Expand Down
3 changes: 3 additions & 0 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#
# installs nova client
#
class nova::client(
$ensure = 'present'
) {
Expand Down
5 changes: 4 additions & 1 deletion manifests/compute/file_hack.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# This is only intended as a temporary fix and needs to be removed
# once the issue is resolved with upstream.
#
# TODO - check if this is still required for folsom
#
#
class nova::compute::file_hack() {

# this only works on Ubunty
Expand All @@ -15,7 +18,7 @@
group => 'root',
mode => '755',
require => Package['nova-compute'],
notify => Service['nova-compute'],
notify => Service['nova-compute'],
}

file { '/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py':
Expand Down
12 changes: 0 additions & 12 deletions manifests/compute/kvm.pp

This file was deleted.

20 changes: 16 additions & 4 deletions manifests/compute/libvirt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,27 @@
require => Package['libvirt'],
}

case $libvirt_type {
'kvm': {
package { $::nova::params::libvirt_type_kvm:
ensure => present,
before => Package['nova-compute'],
}
}
}

nova_config {
'compute_driver': value => 'libvirt.LibvirtDriver';
'libvirt_type': value => $libvirt_type;
'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': }
}
}

nova_config { 'libvirt_type': value => $libvirt_type }
nova_config { 'connection_type': value => 'libvirt' }
nova_config { 'vncserver_listen': value => $vncserver_listen }
}
40 changes: 0 additions & 40 deletions manifests/compute/multi_host.pp

This file was deleted.

Loading

0 comments on commit 10b57ad

Please sign in to comment.