From 800054cc9013097340e1ef48bcca34bed5d7d41c Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 11:09:43 +0200 Subject: [PATCH 01/10] Add cinder api puppet resource Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/README.md | 106 ++++++++++++++++++ resources/cinder_api_puppet/actions/remove.pp | 4 + resources/cinder_api_puppet/actions/run.pp | 51 +++++++++ resources/cinder_api_puppet/meta.yaml | 81 +++++++++++++ resources/cinder_api_puppet/test.py | 10 ++ 5 files changed, 252 insertions(+) create mode 100644 resources/cinder_api_puppet/README.md create mode 100644 resources/cinder_api_puppet/actions/remove.pp create mode 100644 resources/cinder_api_puppet/actions/run.pp create mode 100644 resources/cinder_api_puppet/meta.yaml create mode 100644 resources/cinder_api_puppet/test.py diff --git a/resources/cinder_api_puppet/README.md b/resources/cinder_api_puppet/README.md new file mode 100644 index 00000000..9e098d5c --- /dev/null +++ b/resources/cinder_api_puppet/README.md @@ -0,0 +1,106 @@ +# Cinder API resource for puppet handler +# +# source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/api.pp +# +# Setup and configure the cinder API endpoint +# +# === Parameters +# +# [*keystone_password*] +# The password to use for authentication (keystone) +# +# [*keystone_enabled*] +# (optional) Use keystone for authentification +# Defaults to true +# +# [*keystone_tenant*] +# (optional) The tenant of the auth user +# Defaults to services +# +# [*keystone_user*] +# (optional) The name of the auth user +# Defaults to cinder +# +# [*keystone_auth_host*] +# (optional) The keystone host +# Defaults to localhost +# +# [*keystone_auth_port*] +# (optional) The keystone auth port +# Defaults to 35357 +# +# [*keystone_auth_protocol*] +# (optional) The protocol used to access the auth host +# Defaults to http. +# +# [*os_region_name*] +# (optional) Some operations require cinder to make API requests +# to Nova. This sets the keystone region to be used for these +# requests. For example, boot-from-volume. +# Defaults to undef. +# +# [*keystone_auth_admin_prefix*] +# (optional) The admin_prefix used to admin endpoint of the auth host +# This allow admin auth URIs like http://auth_host:35357/keystone. +# (where '/keystone' is the admin prefix) +# Defaults to false for empty. If defined, should be a string with a +# leading '/' and no trailing '/'. +# +# [*service_port*] +# (optional) The cinder api port +# Defaults to 5000 +# +# [*service_workers*] +# (optional) Number of cinder-api workers +# Defaults to $::processorcount +# +# [*package_ensure*] +# (optional) The state of the package +# Defaults to present +# +# [*bind_host*] +# (optional) The cinder api bind address +# Defaults to 0.0.0.0 +# +# [*enabled*] +# (optional) The state of the service +# Defaults to true +# +# [*manage_service*] +# (optional) Whether to start/stop the service +# Defaults to true +# +# [*ratelimits*] +# (optional) The state of the service +# Defaults to undef. If undefined the default ratelimiting values are used. +# +# [*ratelimits_factory*] +# (optional) Factory to use for ratelimiting +# Defaults to 'cinder.api.v1.limits:RateLimitingMiddleware.factory' +# +# [*default_volume_type*] +# (optional) default volume type to use. +# This should contain the name of the default volume type to use. +# If not configured, it produces an error when creating a volume +# without specifying a type. +# Defaults to 'false'. +# +# [*validate*] +# (optional) Whether to validate the service is working after any service refreshes +# Defaults to false +# +# [*validation_options*] +# (optional) Service validation options +# Should be a hash of options defined in openstacklib::service_validation +# If empty, defaults values are taken from openstacklib function. +# Default command list volumes. +# Require validate set at True. +# Example: +# glance::api::validation_options: +# glance-api: +# command: check_cinder-api.py +# path: /usr/bin:/bin:/usr/sbin:/sbin +# provider: shell +# tries: 5 +# try_sleep: 10 +# Defaults to {} diff --git a/resources/cinder_api_puppet/actions/remove.pp b/resources/cinder_api_puppet/actions/remove.pp new file mode 100644 index 00000000..2e5bc3df --- /dev/null +++ b/resources/cinder_api_puppet/actions/remove.pp @@ -0,0 +1,4 @@ +class {'cinder::api': + enabled => false, + package_ensure => 'absent' +} diff --git a/resources/cinder_api_puppet/actions/run.pp b/resources/cinder_api_puppet/actions/run.pp new file mode 100644 index 00000000..20a67d94 --- /dev/null +++ b/resources/cinder_api_puppet/actions/run.pp @@ -0,0 +1,51 @@ +$resource = hiera('{{ resource_name }}') + +$ip = $resource['input']['ip']['value'] + +$db_user = $resource['input']['db_user']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] + +$keystone_enabled = $resource['input']['keystone_enabled']['value'] +$keystone_tenant = $resource['input']['keystone_tenant']['value'] +$keystone_user = $resource['input']['keystone_user']['value'] +$keystone_auth_host = $resource['input']['keystone_auth_host']['value'] +$keystone_auth_port = $resource['input']['keystone_auth_port']['value'] +$keystone_auth_protocol = $resource['input']['keystone_auth_protocol']['value'] +$keystone_auth_admin_prefix = $resource['input']['keystone_auth_admin_prefix']['value'] +$keystone_auth_uri = $resource['input']['keystone_auth_uri']['value'] +$os_region_name = $resource['input']['os_region_name']['value'] +$service_port = $resource['input']['service_port']['value'] +$service_workers = $resource['input']['service_workers']['value'] +$package_ensure = $resource['input']['package_ensure']['value'] +$bind_host = $resource['input']['bind_host']['value'] +$enabled = $resource['input']['enabled']['value'] +$manage_service = $resource['input']['manage_service']['value'] +$ratelimits = $resource['input']['ratelimits']['value'] +$default_volume_type = $resource['input']['default_volume_type']['value'] +$ratelimits_factory = $resource['input']['ratelimits_factory']['value'] +$validate = $resource['input']['validate']['value'] +$validation_options = $resource['input']['validation_options']['value'] + +class {'cinder::api': +keystone_enabled => $keystone_enabled, +keystone_tenant => $keystone_tenant, +keystone_user => $keystone_user, +keystone_auth_host => $keystone_auth_host, +keystone_auth_port => $keystone_auth_port, +keystone_auth_protocol => $keystone_auth_protocol, +keystone_auth_admin_prefix => $keystone_auth_admin_prefix, +keystone_auth_uri => $keystone_auth_uri, +os_region_name => $os_region_name, +service_port => $service_port, +service_workers => $service_workers, +package_ensure => $package_ensure, +bind_host => $bind_host, +enabled => $enabled, +manage_service => $manage_service, +ratelimits => $ratelimits, +default_volume_type => $default_volume_type, +ratelimits_factory => $ratelimits_factory, +validate => $validate, +validation_options => $validation_options, +} diff --git a/resources/cinder_api_puppet/meta.yaml b/resources/cinder_api_puppet/meta.yaml new file mode 100644 index 00000000..5bf36521 --- /dev/null +++ b/resources/cinder_api_puppet/meta.yaml @@ -0,0 +1,81 @@ +id: cinder_api_puppet +handler: puppet +puppet_module: cinder_api +version: 1.0.0 +input: + keystone_enabled: + schema: bool + value: true + keystone_tenant: + schema: str + value: 'services' + keystone_user: + schema: str + value: 'cinder' + keystone_auth_host: + schema: str + value: 'localhost' + keystone_auth_port: + schema: int + value: 35357 + keystone_auth_protocol: + schema: str + value: 'http' + keystone_auth_admin_prefix: + schema: bool + value: false + keystone_auth_uri: + schema: bool + value: false + os_region_name: + schema: str + value: undef + service_port: + schema: int + value: 5000 + service_workers: + schema: str + value: $::processorcount + package_ensure: + schema: str + value: 'present' + bind_host: + schema: str + value: '0.0.0.0' + enabled: + schema: bool + value: true + manage_service: + schema: bool + value: true + ratelimits: + schema: str + value: undef + default_volume_type: + schema: bool + value: false + ratelimits_factory: + schema: str + value: + validate: + schema: bool + value: false + validation_options: + schema: {} + value: {} + + git: + schema: {repository: str!, branch: str!} + value: {repository: 'https://github.com/openstack/puppet-cinder_api', branch: '5.1.0'} + + ip: + schema: str! + value: + ssh_key: + schema: str! + value: + ssh_user: + schema: str! + value: + +tags: [resource/cinder_api_service, resources/cinder_api] diff --git a/resources/cinder_api_puppet/test.py b/resources/cinder_api_puppet/test.py new file mode 100644 index 00000000..a6f4d9b7 --- /dev/null +++ b/resources/cinder_api_puppet/test.py @@ -0,0 +1,10 @@ +import requests + +from solar.core.log import log + + +def test(resource): + log.debug('Testing cinder_api_puppet') + requests.get( + 'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value) + ) From 3e6594483699987da8e4723ef858cd550832421b Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 12:39:18 +0200 Subject: [PATCH 02/10] Fix README.md Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/README.md | 210 +++++++++++++------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/resources/cinder_api_puppet/README.md b/resources/cinder_api_puppet/README.md index 9e098d5c..dc5b2bb7 100644 --- a/resources/cinder_api_puppet/README.md +++ b/resources/cinder_api_puppet/README.md @@ -1,106 +1,106 @@ # Cinder API resource for puppet handler -# -# source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/api.pp -# -# Setup and configure the cinder API endpoint -# -# === Parameters -# -# [*keystone_password*] -# The password to use for authentication (keystone) -# -# [*keystone_enabled*] -# (optional) Use keystone for authentification -# Defaults to true -# -# [*keystone_tenant*] -# (optional) The tenant of the auth user -# Defaults to services -# -# [*keystone_user*] -# (optional) The name of the auth user -# Defaults to cinder -# -# [*keystone_auth_host*] -# (optional) The keystone host -# Defaults to localhost -# -# [*keystone_auth_port*] -# (optional) The keystone auth port -# Defaults to 35357 -# -# [*keystone_auth_protocol*] -# (optional) The protocol used to access the auth host -# Defaults to http. -# -# [*os_region_name*] -# (optional) Some operations require cinder to make API requests -# to Nova. This sets the keystone region to be used for these -# requests. For example, boot-from-volume. -# Defaults to undef. -# -# [*keystone_auth_admin_prefix*] -# (optional) The admin_prefix used to admin endpoint of the auth host -# This allow admin auth URIs like http://auth_host:35357/keystone. -# (where '/keystone' is the admin prefix) -# Defaults to false for empty. If defined, should be a string with a -# leading '/' and no trailing '/'. -# -# [*service_port*] -# (optional) The cinder api port -# Defaults to 5000 -# -# [*service_workers*] -# (optional) Number of cinder-api workers -# Defaults to $::processorcount -# -# [*package_ensure*] -# (optional) The state of the package -# Defaults to present -# -# [*bind_host*] -# (optional) The cinder api bind address -# Defaults to 0.0.0.0 -# -# [*enabled*] -# (optional) The state of the service -# Defaults to true -# -# [*manage_service*] -# (optional) Whether to start/stop the service -# Defaults to true -# -# [*ratelimits*] -# (optional) The state of the service -# Defaults to undef. If undefined the default ratelimiting values are used. -# -# [*ratelimits_factory*] -# (optional) Factory to use for ratelimiting -# Defaults to 'cinder.api.v1.limits:RateLimitingMiddleware.factory' -# -# [*default_volume_type*] -# (optional) default volume type to use. -# This should contain the name of the default volume type to use. -# If not configured, it produces an error when creating a volume -# without specifying a type. -# Defaults to 'false'. -# -# [*validate*] -# (optional) Whether to validate the service is working after any service refreshes -# Defaults to false -# -# [*validation_options*] -# (optional) Service validation options -# Should be a hash of options defined in openstacklib::service_validation -# If empty, defaults values are taken from openstacklib function. -# Default command list volumes. -# Require validate set at True. -# Example: -# glance::api::validation_options: -# glance-api: -# command: check_cinder-api.py -# path: /usr/bin:/bin:/usr/sbin:/sbin -# provider: shell -# tries: 5 -# try_sleep: 10 -# Defaults to {} + +Setup and configure the cinder API endpoint + +## Parameters + +source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/api.pp + + ``keystone_password`` + The password to use for authentication (keystone) + + ``keystone_enabled`` + (optional) Use keystone for authentification + Defaults to true + + ``keystone_tenant`` + (optional) The tenant of the auth user + Defaults to services + + ``keystone_user`` + (optional) The name of the auth user + Defaults to cinder + + ``keystone_auth_host`` + (optional) The keystone host + Defaults to localhost + + ``keystone_auth_port`` + (optional) The keystone auth port + Defaults to 35357 + + ``keystone_auth_protocol`` + (optional) The protocol used to access the auth host + Defaults to http. + + ``os_region_name`` + (optional) Some operations require cinder to make API requests + to Nova. This sets the keystone region to be used for these + requests. For example, boot-from-volume. + Defaults to undef. + + ``keystone_auth_admin_prefix`` + (optional) The admin_prefix used to admin endpoint of the auth host + This allow admin auth URIs like http://auth_host:35357/keystone. + (where '/keystone' is the admin prefix) + Defaults to false for empty. If defined, should be a string with a + leading '/' and no trailing '/'. + + ``service_port`` + (optional) The cinder api port + Defaults to 5000 + + ``service_workers`` + (optional) Number of cinder-api workers + Defaults to $::processorcount + + ``package_ensure`` + (optional) The state of the package + Defaults to present + + ``bind_host`` + (optional) The cinder api bind address + Defaults to 0.0.0.0 + + ``enabled`` + (optional) The state of the service + Defaults to true + + ``manage_service`` + (optional) Whether to start/stop the service + Defaults to true + + ``ratelimits`` + (optional) The state of the service + Defaults to undef. If undefined the default ratelimiting values are used. + + ``ratelimits_factory`` + (optional) Factory to use for ratelimiting + Defaults to 'cinder.api.v1.limits:RateLimitingMiddleware.factory' + + ``default_volume_type`` + (optional) default volume type to use. + This should contain the name of the default volume type to use. + If not configured, it produces an error when creating a volume + without specifying a type. + Defaults to 'false'. + + ``validate`` + (optional) Whether to validate the service is working after any service refreshes + Defaults to false + + ``validation_options`` + (optional) Service validation options + Should be a hash of options defined in openstacklib::service_validation + If empty, defaults values are taken from openstacklib function. + Default command list volumes. + Require validate set at True. + Example: + glance::api::validation_options: + glance-api: + command: check_cinder-api.py + path: /usr/bin:/bin:/usr/sbin:/sbin + provider: shell + tries: 5 + try_sleep: 10 + Defaults to {} From 7e583a41bcd9dc684bea45f71356c4d380b7bc0c Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 13:16:14 +0200 Subject: [PATCH 03/10] Fix cinder api resource metadata Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/meta.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/cinder_api_puppet/meta.yaml b/resources/cinder_api_puppet/meta.yaml index 5bf36521..bd6ed455 100644 --- a/resources/cinder_api_puppet/meta.yaml +++ b/resources/cinder_api_puppet/meta.yaml @@ -3,6 +3,9 @@ handler: puppet puppet_module: cinder_api version: 1.0.0 input: + keystone_password: + schema: str! + value: 'keystone' keystone_enabled: schema: bool value: true @@ -56,7 +59,7 @@ input: value: false ratelimits_factory: schema: str - value: + value: 'cinder.api.v1.limits:RateLimitingMiddleware.factory' validate: schema: bool value: false From fec5a99852ed1f6e8adae75ceb2a5e670796bfcd Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 13:16:27 +0200 Subject: [PATCH 04/10] Add a composition layer for cinder api Signed-off-by: Bogdan Dobrelya --- example-puppet.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/example-puppet.py b/example-puppet.py index fea64410..02eaa7cd 100644 --- a/example-puppet.py +++ b/example-puppet.py @@ -259,6 +259,15 @@ def deploy(): signals.connect(keystone_puppet, cinder_keystone_service_endpoint, { 'admin_port': 'keystone_admin_port', 'admin_token': 'admin_token'}) + # CINDER API + cinder_api_puppet = vr.create('cinder_api_puppet', 'resources/cinder_api_puppet', {})[0] + signals.connect(node1, cinder_api_puppet) + signals.connect(cinder_puppet, cinder_api_puppet, { + 'keystone_password', 'keystone_tenant', 'keystone_user'}) + signals.connect(cinder_puppet, cinder_api_puppet, { + 'keystone_host': 'keystone_auth_host', + 'keystone_port': 'keystone_auth_port'}) + # NOVA # #nova_network_puppet = vr.create('nova_network_puppet', GitProvider(GIT_PUPPET_LIBS_URL, 'nova_network'), {'rabbitmq_user': 'guest', 'rabbitmq_password': 'guest'})[0] # # TODO: fix rabbitmq user/password @@ -328,6 +337,7 @@ def deploy(): actions.resource_action(cinder_keystone_role, 'run') actions.resource_action(cinder_puppet, 'run') actions.resource_action(cinder_keystone_service_endpoint, 'run') + actions.resource_action(cinder_api_puppet, 'run') # actions.resource_action(nova_keystone_user, 'run') # actions.resource_action(nova_keystone_role, 'run') @@ -343,6 +353,7 @@ def undeploy(): db = get_db() to_remove = [ + 'cinder_api_puppet', 'cinder_keystone_service_endpoint', 'cinder_puppet', 'cinder_keystone_role', From deb52a8c66850d7aaa06f7168d573942cb5af789 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 13:24:18 +0200 Subject: [PATCH 05/10] Fix cinder api resource metadata Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/cinder_api_puppet/meta.yaml b/resources/cinder_api_puppet/meta.yaml index bd6ed455..edf45dc9 100644 --- a/resources/cinder_api_puppet/meta.yaml +++ b/resources/cinder_api_puppet/meta.yaml @@ -37,8 +37,8 @@ input: schema: int value: 5000 service_workers: - schema: str - value: $::processorcount + schema: int + value: 1 package_ensure: schema: str value: 'present' From e6b033fb95c68c803931e30d1b12a689f474da94 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 14:37:19 +0200 Subject: [PATCH 06/10] Fix indentation and parameters Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/actions/run.pp | 46 ++++---- resources/cinder_api_puppet/meta.yaml | 130 ++++++++++----------- 2 files changed, 87 insertions(+), 89 deletions(-) diff --git a/resources/cinder_api_puppet/actions/run.pp b/resources/cinder_api_puppet/actions/run.pp index 20a67d94..aad0311e 100644 --- a/resources/cinder_api_puppet/actions/run.pp +++ b/resources/cinder_api_puppet/actions/run.pp @@ -2,10 +2,7 @@ $resource = hiera('{{ resource_name }}') $ip = $resource['input']['ip']['value'] -$db_user = $resource['input']['db_user']['value'] -$db_password = $resource['input']['db_password']['value'] -$db_name = $resource['input']['db_name']['value'] - +$keystone_password = $resource['input']['keystone_password']['value'] $keystone_enabled = $resource['input']['keystone_enabled']['value'] $keystone_tenant = $resource['input']['keystone_tenant']['value'] $keystone_user = $resource['input']['keystone_user']['value'] @@ -28,24 +25,25 @@ $validate = $resource['input']['validate']['value'] $validation_options = $resource['input']['validation_options']['value'] class {'cinder::api': -keystone_enabled => $keystone_enabled, -keystone_tenant => $keystone_tenant, -keystone_user => $keystone_user, -keystone_auth_host => $keystone_auth_host, -keystone_auth_port => $keystone_auth_port, -keystone_auth_protocol => $keystone_auth_protocol, -keystone_auth_admin_prefix => $keystone_auth_admin_prefix, -keystone_auth_uri => $keystone_auth_uri, -os_region_name => $os_region_name, -service_port => $service_port, -service_workers => $service_workers, -package_ensure => $package_ensure, -bind_host => $bind_host, -enabled => $enabled, -manage_service => $manage_service, -ratelimits => $ratelimits, -default_volume_type => $default_volume_type, -ratelimits_factory => $ratelimits_factory, -validate => $validate, -validation_options => $validation_options, + keystone_password => $keystone_password, + keystone_enabled => $keystone_enabled, + keystone_tenant => $keystone_tenant, + keystone_user => $keystone_user, + keystone_auth_host => $keystone_auth_host, + keystone_auth_port => $keystone_auth_port, + keystone_auth_protocol => $keystone_auth_protocol, + keystone_auth_admin_prefix => $keystone_auth_admin_prefix, + keystone_auth_uri => $keystone_auth_uri, + os_region_name => $os_region_name, + service_port => $service_port, + service_workers => $service_workers, + package_ensure => $package_ensure, + bind_host => $bind_host, + enabled => $enabled, + manage_service => $manage_service, + ratelimits => $ratelimits, + default_volume_type => $default_volume_type, + ratelimits_factory => $ratelimits_factory, + validate => $validate, + validation_options => $validation_options, } diff --git a/resources/cinder_api_puppet/meta.yaml b/resources/cinder_api_puppet/meta.yaml index edf45dc9..a6b8dcb0 100644 --- a/resources/cinder_api_puppet/meta.yaml +++ b/resources/cinder_api_puppet/meta.yaml @@ -3,73 +3,73 @@ handler: puppet puppet_module: cinder_api version: 1.0.0 input: - keystone_password: - schema: str! - value: 'keystone' - keystone_enabled: - schema: bool - value: true - keystone_tenant: - schema: str - value: 'services' - keystone_user: - schema: str - value: 'cinder' - keystone_auth_host: - schema: str - value: 'localhost' - keystone_auth_port: - schema: int - value: 35357 - keystone_auth_protocol: - schema: str - value: 'http' - keystone_auth_admin_prefix: - schema: bool - value: false - keystone_auth_uri: - schema: bool - value: false - os_region_name: - schema: str - value: undef - service_port: - schema: int - value: 5000 - service_workers: - schema: int - value: 1 - package_ensure: - schema: str - value: 'present' - bind_host: - schema: str - value: '0.0.0.0' - enabled: - schema: bool - value: true - manage_service: - schema: bool - value: true - ratelimits: - schema: str - value: undef - default_volume_type: - schema: bool - value: false - ratelimits_factory: - schema: str - value: 'cinder.api.v1.limits:RateLimitingMiddleware.factory' - validate: - schema: bool - value: false - validation_options: - schema: {} - value: {} + keystone_password: + schema: str! + value: 'keystone' + keystone_enabled: + schema: bool + value: true + keystone_tenant: + schema: str + value: 'services' + keystone_user: + schema: str + value: 'cinder' + keystone_auth_host: + schema: str + value: 'localhost' + keystone_auth_port: + schema: int + value: 35357 + keystone_auth_protocol: + schema: str + value: 'http' + keystone_auth_admin_prefix: + schema: bool + value: false + keystone_auth_uri: + schema: bool + value: false + os_region_name: + schema: str + value: undef + service_port: + schema: int + value: 5000 + service_workers: + schema: int + value: 1 + package_ensure: + schema: str + value: 'present' + bind_host: + schema: str + value: '0.0.0.0' + enabled: + schema: bool + value: true + manage_service: + schema: bool + value: true + ratelimits: + schema: str + value: undef + default_volume_type: + schema: bool + value: false + ratelimits_factory: + schema: str + value: 'cinder.api.v1.limits:RateLimitingMiddleware.factory' + validate: + schema: bool + value: false + validation_options: + schema: {} + value: {} git: schema: {repository: str!, branch: str!} - value: {repository: 'https://github.com/openstack/puppet-cinder_api', branch: '5.1.0'} + value: {repository: 'https://github.com/openstack/puppet-cinder', branch: '5.1.0'} ip: schema: str! @@ -81,4 +81,4 @@ input: schema: str! value: -tags: [resource/cinder_api_service, resources/cinder_api] +tags: [resource/cinder_api_service, resources/cinder_api, resources/cinder] From 9d6e5fe05815d146812d62c0a76a6cfaaef5a01c Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 14:57:52 +0200 Subject: [PATCH 07/10] Fix package cinder dependency for cinder api Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/actions/remove.pp | 7 +++++++ resources/cinder_api_puppet/actions/run.pp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/resources/cinder_api_puppet/actions/remove.pp b/resources/cinder_api_puppet/actions/remove.pp index 2e5bc3df..35303039 100644 --- a/resources/cinder_api_puppet/actions/remove.pp +++ b/resources/cinder_api_puppet/actions/remove.pp @@ -2,3 +2,10 @@ class {'cinder::api': enabled => false, package_ensure => 'absent' } + +include cinder::params + +package { 'cinder': + ensure => 'absent', + name => $::cinder::params::package_name, +} \ No newline at end of file diff --git a/resources/cinder_api_puppet/actions/run.pp b/resources/cinder_api_puppet/actions/run.pp index aad0311e..0226e15c 100644 --- a/resources/cinder_api_puppet/actions/run.pp +++ b/resources/cinder_api_puppet/actions/run.pp @@ -24,6 +24,13 @@ $ratelimits_factory = $resource['input']['ratelimits_factory']['value'] $validate = $resource['input']['validate']['value'] $validation_options = $resource['input']['validation_options']['value'] +include cinder::params + +package { 'cinder': + ensure => $package_ensure, + name => $::cinder::params::package_name, +} -> + class {'cinder::api': keystone_password => $keystone_password, keystone_enabled => $keystone_enabled, From 3c8ffc9f722c21a0cca0af3281fdda90ed69c49b Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 20 Jul 2015 15:27:53 +0200 Subject: [PATCH 08/10] Replace undef to empty strings for cinder api Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/cinder_api_puppet/meta.yaml b/resources/cinder_api_puppet/meta.yaml index a6b8dcb0..e2cdcfd7 100644 --- a/resources/cinder_api_puppet/meta.yaml +++ b/resources/cinder_api_puppet/meta.yaml @@ -32,7 +32,7 @@ input: value: false os_region_name: schema: str - value: undef + value: '' service_port: schema: int value: 5000 @@ -53,7 +53,7 @@ input: value: true ratelimits: schema: str - value: undef + value: '' default_volume_type: schema: bool value: false From e2a049e037cd2a309f98dc9bab36ab263a6d5c99 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Tue, 21 Jul 2015 13:58:41 +0200 Subject: [PATCH 09/10] Fix undeploy and resource_name ref at cinder api Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/actions/remove.pp | 3 ++- resources/cinder_api_puppet/actions/run.pp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/cinder_api_puppet/actions/remove.pp b/resources/cinder_api_puppet/actions/remove.pp index 35303039..f533cb1a 100644 --- a/resources/cinder_api_puppet/actions/remove.pp +++ b/resources/cinder_api_puppet/actions/remove.pp @@ -1,6 +1,7 @@ class {'cinder::api': enabled => false, - package_ensure => 'absent' + package_ensure => 'absent', + keystone_password => 'not important as removed', } include cinder::params diff --git a/resources/cinder_api_puppet/actions/run.pp b/resources/cinder_api_puppet/actions/run.pp index 0226e15c..a5e2eb1a 100644 --- a/resources/cinder_api_puppet/actions/run.pp +++ b/resources/cinder_api_puppet/actions/run.pp @@ -1,4 +1,4 @@ -$resource = hiera('{{ resource_name }}') +$resource = hiera($::resource_name) $ip = $resource['input']['ip']['value'] From 5297e171fbcc5a4ed77e8b70b118ec4c574842ba Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 22 Jul 2015 15:28:45 +0200 Subject: [PATCH 10/10] Remove enabled and manage_service for c-api Signed-off-by: Bogdan Dobrelya --- resources/cinder_api_puppet/README.md | 8 -------- resources/cinder_api_puppet/actions/run.pp | 8 ++------ resources/cinder_api_puppet/meta.yaml | 6 ------ 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/resources/cinder_api_puppet/README.md b/resources/cinder_api_puppet/README.md index dc5b2bb7..177e119a 100644 --- a/resources/cinder_api_puppet/README.md +++ b/resources/cinder_api_puppet/README.md @@ -62,14 +62,6 @@ source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/api.pp (optional) The cinder api bind address Defaults to 0.0.0.0 - ``enabled`` - (optional) The state of the service - Defaults to true - - ``manage_service`` - (optional) Whether to start/stop the service - Defaults to true - ``ratelimits`` (optional) The state of the service Defaults to undef. If undefined the default ratelimiting values are used. diff --git a/resources/cinder_api_puppet/actions/run.pp b/resources/cinder_api_puppet/actions/run.pp index a5e2eb1a..857cbca1 100644 --- a/resources/cinder_api_puppet/actions/run.pp +++ b/resources/cinder_api_puppet/actions/run.pp @@ -1,7 +1,5 @@ $resource = hiera($::resource_name) -$ip = $resource['input']['ip']['value'] - $keystone_password = $resource['input']['keystone_password']['value'] $keystone_enabled = $resource['input']['keystone_enabled']['value'] $keystone_tenant = $resource['input']['keystone_tenant']['value'] @@ -16,8 +14,6 @@ $service_port = $resource['input']['service_port']['value'] $service_workers = $resource['input']['service_workers']['value'] $package_ensure = $resource['input']['package_ensure']['value'] $bind_host = $resource['input']['bind_host']['value'] -$enabled = $resource['input']['enabled']['value'] -$manage_service = $resource['input']['manage_service']['value'] $ratelimits = $resource['input']['ratelimits']['value'] $default_volume_type = $resource['input']['default_volume_type']['value'] $ratelimits_factory = $resource['input']['ratelimits_factory']['value'] @@ -46,8 +42,8 @@ class {'cinder::api': service_workers => $service_workers, package_ensure => $package_ensure, bind_host => $bind_host, - enabled => $enabled, - manage_service => $manage_service, + enabled => true, + manage_service => true, ratelimits => $ratelimits, default_volume_type => $default_volume_type, ratelimits_factory => $ratelimits_factory, diff --git a/resources/cinder_api_puppet/meta.yaml b/resources/cinder_api_puppet/meta.yaml index e2cdcfd7..6164176a 100644 --- a/resources/cinder_api_puppet/meta.yaml +++ b/resources/cinder_api_puppet/meta.yaml @@ -45,12 +45,6 @@ input: bind_host: schema: str value: '0.0.0.0' - enabled: - schema: bool - value: true - manage_service: - schema: bool - value: true ratelimits: schema: str value: ''