Add cinder volume puppet resource
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
parent
db94a28229
commit
a23ddc735d
3
resources/cinder_volume_puppet/README.md
Normal file
3
resources/cinder_volume_puppet/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Cinder Volume resource for puppet handler
|
||||||
|
|
||||||
|
Setup and configure the cinder volume service
|
4
resources/cinder_volume_puppet/actions/remove.pp
Normal file
4
resources/cinder_volume_puppet/actions/remove.pp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class {'cinder::volume':
|
||||||
|
enabled => false,
|
||||||
|
package_ensure => 'absent',
|
||||||
|
}
|
18
resources/cinder_volume_puppet/actions/run.pp
Normal file
18
resources/cinder_volume_puppet/actions/run.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
$resource = hiera($::resource_name)
|
||||||
|
|
||||||
|
$package_ensure = $resource['input']['package_ensure']['value']
|
||||||
|
$enabled = $resource['input']['enabled']['value']
|
||||||
|
$manage_service = $resource['input']['manage_service']['value']
|
||||||
|
|
||||||
|
include cinder::params
|
||||||
|
|
||||||
|
package { 'cinder':
|
||||||
|
ensure => $package_ensure,
|
||||||
|
name => $::cinder::params::package_name,
|
||||||
|
} ->
|
||||||
|
|
||||||
|
class {'cinder::volume':
|
||||||
|
package_ensure => $package_ensure,
|
||||||
|
enabled => $enabled,
|
||||||
|
manage_service => $manage_service,
|
||||||
|
}
|
30
resources/cinder_volume_puppet/meta.yaml
Normal file
30
resources/cinder_volume_puppet/meta.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
id: cinder_volume_puppet
|
||||||
|
handler: puppet
|
||||||
|
puppet_module: cinder_volume
|
||||||
|
version: 1.0.0
|
||||||
|
input:
|
||||||
|
package_ensure:
|
||||||
|
schema: str
|
||||||
|
value: 'present'
|
||||||
|
enabled:
|
||||||
|
schema: bool
|
||||||
|
value: true
|
||||||
|
manage_service:
|
||||||
|
schema: bool
|
||||||
|
value: true
|
||||||
|
|
||||||
|
git:
|
||||||
|
schema: {repository: str!, branch: str!}
|
||||||
|
value: {repository: 'https://github.com/openstack/puppet-cinder', branch: '5.1.0'}
|
||||||
|
|
||||||
|
ip:
|
||||||
|
schema: str!
|
||||||
|
value:
|
||||||
|
ssh_key:
|
||||||
|
schema: str!
|
||||||
|
value:
|
||||||
|
ssh_user:
|
||||||
|
schema: str!
|
||||||
|
value:
|
||||||
|
|
||||||
|
tags: [resource/cinder_volume_service, resources/cinder_volume, resources/cinder]
|
12
resources/cinder_volume_puppet/test.py
Normal file
12
resources/cinder_volume_puppet/test.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import requests
|
||||||
|
|
||||||
|
from solar.core.log import log
|
||||||
|
|
||||||
|
|
||||||
|
def test(resource):
|
||||||
|
log.debug('Testing cinder_volume_puppet')
|
||||||
|
# requests.get(
|
||||||
|
# 'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
||||||
|
# TODO(bogdando) figure out how to test this
|
||||||
|
# http://docs.openstack.org/developer/nova/devref/volume.html
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user