From 6ca7a3e62109f8efc821ac98e1c54f5dd31f3f4c 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 --- 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 +++++++++++++++++++ 4 files changed, 76 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/resources/nova_conductor_puppet/README.md b/resources/nova_conductor_puppet/README.md new file mode 100644 index 0000000..26a94d3 --- /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 0000000..9c9fee7 --- /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 0000000..271fc17 --- /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 0000000..39b4c3f --- /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]