Merge pull request #73 from Mirantis/bogdando/nova

Bogdando/nova
This commit is contained in:
CGenie 2015-09-03 12:08:22 +02:00
commit c96701c428
5 changed files with 93 additions and 0 deletions

View File

@ -448,6 +448,14 @@ def setup_resources():
signals.connect(node1, nova_conductor_puppet)
signals.connect(nova_puppet, nova_conductor_puppet)
# NOVA SCHEDULER
# NOTE(bogdando) Generic service is used. Package and service names for Ubuntu case
# come from https://github.com/openstack/puppet-nova/blob/5.1.0/manifests/params.pp
nova_scheduler_puppet = vr.create('nova_scheduler_puppet', 'resources/nova_generic_service_puppet', {
'title' : 'scheduler', 'package_name': 'nova-scheduler', 'service_name': 'nova-scheduler',
})[0]
signals.connect(node1, nova_scheduler_puppet)
# NOVA COMPUTE
# Deploy chain (nova, node_networking(TODO)) -> (nova_compute_libvirt, nova_neutron) -> nova_compute
nova_compute_puppet = vr.create('nova_compute_puppet', 'resources/nova_compute_puppet', {})[0]
@ -634,6 +642,7 @@ resources_to_run = [
'nova_keystone_service_endpoint',
'nova_api_puppet',
'nova_conductor_puppet',
'nova_scheduler_puppet',
'glance_db',
'glance_db_user',

View File

@ -0,0 +1,5 @@
# Nova generic service resource for puppet handler
Setup and configure the Nova generic services.
source https://github.com/openstack/puppet-nova/blob/5.1.0/manifests/generic_service.pp

View File

@ -0,0 +1,21 @@
$service_title = $resource['input']['title']['value']
$package_name = $resource['input']['package_name']['value']
$service_name = $resource['input']['service_name']['value']
exec { 'post-nova_config':
command => '/bin/echo "Nova config has changed"',
}
nova::generic_service { $service_title:
ensure_package => 'absent',
enabled => false,
package_name => $package_name,
service_name => $service_name,
}
include nova::params
package { 'nova-common':
name => $nova::params::common_package_name,
ensure => 'absent',
}

View File

@ -0,0 +1,25 @@
$resource = hiera($::resource_name)
$service_title = $resource['input']['title']['value']
$package_name = $resource['input']['package_name']['value']
$service_name = $resource['input']['service_name']['value']
$ensure_package = $resource['input']['ensure_package']['value']
exec { 'post-nova_config':
command => '/bin/echo "Nova config has changed"',
}
include nova::params
package { 'nova-common':
name => $nova::params::common_package_name,
ensure => $ensure_package,
}
nova::generic_service { $service_title:
enabled => true,
manage_service => true,
package_name => $package_name,
service_name => $service_name,
ensure_package => $ensure_package,
}

View File

@ -0,0 +1,33 @@
id: nova_generic_service
handler: puppet
puppet_module: nova
version: 1.0.0
input:
title:
schema: str!
value:
package_name:
schema: str!
value:
service_name:
schema: str!
value:
ensure_package:
schema: str
value: 'present'
git:
schema: {repository: str!, branch: str!}
value: {repository: 'https://github.com/openstack/puppet-nova', branch: '5.1.0'}
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
tags: [resource/nova_generic_service, resources/nova]