2012-04-01 14:23:36 -07:00
|
|
|
class nova::api(
|
2012-04-23 17:46:17 -07:00
|
|
|
$enabled = false,
|
2012-05-08 13:32:36 -05:00
|
|
|
$ensure_package = 'present',
|
2012-04-23 17:46:17 -07:00
|
|
|
$auth_strategy = 'keystone',
|
|
|
|
$auth_host = '127.0.0.1',
|
|
|
|
$auth_port = 35357,
|
|
|
|
$auth_protocol = 'http',
|
|
|
|
$admin_tenant_name = 'services',
|
|
|
|
$admin_user = 'nova',
|
|
|
|
$admin_password = 'passw0rd'
|
2012-04-23 16:57:54 -07:00
|
|
|
) {
|
|
|
|
|
|
|
|
include nova::params
|
2011-05-27 11:25:26 -07:00
|
|
|
|
2012-10-09 22:22:37 -07:00
|
|
|
Package<| title == 'nova-api' |> -> Exec['nova-db-sync']
|
|
|
|
Package<| title == 'nova-api' |> -> Nova_paste_api_ini<| |>
|
2012-04-07 19:32:13 -07:00
|
|
|
|
2012-10-09 22:22:37 -07:00
|
|
|
Nova_paste_api_ini<| |> ~> Exec['post-nova_config']
|
|
|
|
Nova_paste_api_ini<| |> ~> Service['nova-api']
|
2011-06-22 16:49:59 -07:00
|
|
|
|
2012-04-01 14:23:36 -07:00
|
|
|
nova::generic_service { 'api':
|
2012-05-08 13:32:36 -05:00
|
|
|
enabled => $enabled,
|
|
|
|
ensure_package => $ensure_package,
|
|
|
|
package_name => $::nova::params::api_package_name,
|
|
|
|
service_name => $::nova::params::api_service_name,
|
2012-03-30 13:09:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-30 09:46:52 -07:00
|
|
|
nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; }
|
2012-04-08 22:40:50 +00:00
|
|
|
|
2012-10-09 22:22:37 -07:00
|
|
|
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;
|
2011-05-26 12:19:52 -07:00
|
|
|
}
|
2012-10-09 22:25:00 -07:00
|
|
|
|
|
|
|
# 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'],
|
|
|
|
}
|
|
|
|
|
2011-05-26 12:19:52 -07:00
|
|
|
}
|