From 5d5960190badf35ba8232863fae75b5f4509c402 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 3 Aug 2015 16:08:15 +0200 Subject: [PATCH] Add cinder volume ISCSI resource Add ISCSI backend as enabled default for the cinder_volume resource. Note, cannot be decoupled as a separate resource because of the external puppet class reference hardcoded upstream. Signed-off-by: Bogdan Dobrelya --- resources/cinder_volume_puppet/README.md | 7 ++++++- resources/cinder_volume_puppet/actions/run.pp | 15 +++++++++++++++ resources/cinder_volume_puppet/meta.yaml | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/resources/cinder_volume_puppet/README.md b/resources/cinder_volume_puppet/README.md index 59b1042..e597c2b 100644 --- a/resources/cinder_volume_puppet/README.md +++ b/resources/cinder_volume_puppet/README.md @@ -1,3 +1,8 @@ # Cinder Volume resource for puppet handler -Setup and configure the cinder volume service +Setup and configure the cinder volume service. +Configure ISCSI volume backend for cinder volume nodes, if specified +(Default true) + +source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/volume/iscsi.pp +source https://github.com/openstack/puppet-cinder/blob/5.1.0/manifests/volume.pp \ No newline at end of file diff --git a/resources/cinder_volume_puppet/actions/run.pp b/resources/cinder_volume_puppet/actions/run.pp index 4f66e2e..91e9b5d 100644 --- a/resources/cinder_volume_puppet/actions/run.pp +++ b/resources/cinder_volume_puppet/actions/run.pp @@ -1,6 +1,12 @@ $resource = hiera($::resource_name) $package_ensure = $resource['input']['package_ensure']['value'] +$use_iscsi_backend = $resource['input']['use_iscsi_backend']['value'] + +$iscsi_ip_address = $resource['input']['iscsi_ip_address']['value'] +$volume_driver = $resource['input']['volume_driver']['value'] +$volume_group = $resource['input']['volume_group']['value'] +$iscsi_helper = $resource['input']['iscsi_helper']['value'] include cinder::params @@ -14,3 +20,12 @@ class {'cinder::volume': enabled => true, manage_service => true, } + +if $use_iscsi_backend { + class {'cinder::volume::iscsi': + iscsi_ip_address => $iscsi_ip_address, + volume_driver => $volume_driver, + volume_group => $volume_group, + iscsi_helper => $iscsi_helper, + } +} \ No newline at end of file diff --git a/resources/cinder_volume_puppet/meta.yaml b/resources/cinder_volume_puppet/meta.yaml index 9146a15..f1e5e12 100644 --- a/resources/cinder_volume_puppet/meta.yaml +++ b/resources/cinder_volume_puppet/meta.yaml @@ -6,6 +6,22 @@ input: package_ensure: schema: str value: 'present' + iscsi_ip_address: + schema: str + value: '127.0.0.1' + volume_driver: + schema: str + value: 'cinder.volume.drivers.lvm.LVMISCSIDriver' + volume_group: + schema: str + value: 'cinder-volumes' + iscsi_helper: + schema: str + value: 'tgtadm' + + use_iscsi_backend: + schema: bool + value: true git: schema: {repository: str!, branch: str!}