From 041161cf17752fd2c11fc35dc55e1e7320496e5d Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Thu, 30 Jul 2015 15:47:26 +0200 Subject: [PATCH] Add nova conductor resource Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 7 +++++ resources/nova_conductor_puppet/README.md | 16 +++++++++++ .../nova_conductor_puppet/actions/remove.pp | 11 ++++++++ .../nova_conductor_puppet/actions/run.pp | 22 +++++++++++++++ resources/nova_conductor_puppet/meta.yaml | 27 +++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 resources/nova_conductor_puppet/README.md create mode 100644 resources/nova_conductor_puppet/actions/remove.pp create mode 100644 resources/nova_conductor_puppet/actions/run.pp create mode 100644 resources/nova_conductor_puppet/meta.yaml diff --git a/example-puppet.py b/example-puppet.py index bb017fb8..15594fd8 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -355,6 +355,11 @@ def deploy(): 'keystone_host': 'auth_host', 'keystone_port': 'auth_port'}) + # NOVA CONDUCTOR + nova_conductor_puppet = vr.create('nova_conductor_puppet', 'resources/nova_conductor_puppet', {})[0] + signals.connect(node1, nova_conductor_puppet) + signals.connect(nova_puppet, nova_conductor_puppet) + # signals.connect(keystone_puppet, nova_network_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'}) # signals.connect(keystone_puppet, nova_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_port', 'admin_token': 'admin_token'}) # signals.connect(rabbitmq_service1, nova_network_puppet, {'ip': 'rabbitmq_host', 'port': 'rabbitmq_port'}) @@ -482,6 +487,7 @@ def deploy(): actions.resource_action(nova_puppet, 'run') actions.resource_action(nova_keystone_service_endpoint, 'run') actions.resource_action(nova_api_puppet, 'run') + actions.resource_action(nova_conductor_puppet, 'run') actions.resource_action(glance_db, 'run') actions.resource_action(glance_db_user, 'run') @@ -511,6 +517,7 @@ def undeploy(): 'nova_db', 'nova_db_user', 'nova_keystone_service_endpoint', + 'nova_conductor_puppet', 'nova_api_puppet', 'nova_puppet', 'cinder_volume_puppet', diff --git a/resources/nova_conductor_puppet/README.md b/resources/nova_conductor_puppet/README.md new file mode 100644 index 00000000..26a94d35 --- /dev/null +++ b/resources/nova_conductor_puppet/README.md @@ -0,0 +1,16 @@ +# Nova conductor resource for puppet handler + +Setup and configure the Nova conductor service. +Note, it [should not](http://docs.openstack.org/juno/config-reference/content/section_conductor.html) be deployed on compute nodes. + +# Parameters + +source https://github.com/openstack/puppet-nova_conductor/blob/5.1.0/manifests/conductor.pp + + ``ensure_package`` + (optional) The state of the nova conductor package + Defaults to 'present' + + ``workers`` + (optional) Number of workers for OpenStack Conductor service + Defaults to undef (i.e. parameter will not be present) \ No newline at end of file diff --git a/resources/nova_conductor_puppet/actions/remove.pp b/resources/nova_conductor_puppet/actions/remove.pp new file mode 100644 index 00000000..9c9fee76 --- /dev/null +++ b/resources/nova_conductor_puppet/actions/remove.pp @@ -0,0 +1,11 @@ +class { 'nova::conductor': + ensure_package => 'absent', + enabled => false, +} + +include nova::params + +package { 'nova-common': + name => $nova::params::common_package_name, + ensure => 'absent', +} \ No newline at end of file diff --git a/resources/nova_conductor_puppet/actions/run.pp b/resources/nova_conductor_puppet/actions/run.pp new file mode 100644 index 00000000..271fc179 --- /dev/null +++ b/resources/nova_conductor_puppet/actions/run.pp @@ -0,0 +1,22 @@ +$resource = hiera($::resource_name) + +$ensure_package = $resource['input']['ensure_package']['value'] +$workers = $resource['input']['workers']['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, +} + +class { 'nova::conductor': + enabled => true, + manage_service => true, + ensure_package => $ensure_package, + workers => $workers, +} \ No newline at end of file diff --git a/resources/nova_conductor_puppet/meta.yaml b/resources/nova_conductor_puppet/meta.yaml new file mode 100644 index 00000000..39b4c3f5 --- /dev/null +++ b/resources/nova_conductor_puppet/meta.yaml @@ -0,0 +1,27 @@ +id: nova_conductor +handler: puppet +puppet_module: nova +version: 1.0.0 +input: + ensure_package: + schema: str + value: 'present' + workers: + schema: int + value: 1 + + 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_conductor_service, resources/nova_conductor, resources/nova]