Merge "Moved cinder::volume::iscsi out of main template"
This commit is contained in:
@@ -206,8 +206,6 @@ def initSequences(controller):
|
|||||||
return
|
return
|
||||||
|
|
||||||
cinder_steps = [
|
cinder_steps = [
|
||||||
{'title': 'Installing dependencies for Cinder',
|
|
||||||
'functions': [install_cinder_deps]},
|
|
||||||
{'title': 'Adding Cinder Keystone manifest entries',
|
{'title': 'Adding Cinder Keystone manifest entries',
|
||||||
'functions': [create_keystone_manifest]},
|
'functions': [create_keystone_manifest]},
|
||||||
{'title': 'Adding Cinder manifest entries',
|
{'title': 'Adding Cinder manifest entries',
|
||||||
@@ -223,17 +221,6 @@ def initSequences(controller):
|
|||||||
|
|
||||||
#-------------------------- step functions --------------------------
|
#-------------------------- step functions --------------------------
|
||||||
|
|
||||||
def install_cinder_deps(config, messages):
|
|
||||||
server = utils.ScriptRunner(config['CONFIG_CONTROLLER_HOST'])
|
|
||||||
pkgs = []
|
|
||||||
if config['CONFIG_CINDER_BACKEND'] == 'lvm':
|
|
||||||
pkgs.append('lvm2')
|
|
||||||
for p in pkgs:
|
|
||||||
server.append("rpm -q --whatprovides %(package)s || "
|
|
||||||
"yum install -y %(package)s" % dict(package=p))
|
|
||||||
server.execute()
|
|
||||||
|
|
||||||
|
|
||||||
def check_cinder_vg(config, messages):
|
def check_cinder_vg(config, messages):
|
||||||
cinders_volume = 'cinder-volumes'
|
cinders_volume = 'cinder-volumes'
|
||||||
|
|
||||||
@@ -271,6 +258,8 @@ def check_cinder_vg(config, messages):
|
|||||||
output_messages.INFO_CINDER_VOLUMES_EXISTS)
|
output_messages.INFO_CINDER_VOLUMES_EXISTS)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# TO-DO: This is implemented in cinder::setup_test_volume class.
|
||||||
|
# We should use it instead of this Python code
|
||||||
server = utils.ScriptRunner(config['CONFIG_CONTROLLER_HOST'])
|
server = utils.ScriptRunner(config['CONFIG_CONTROLLER_HOST'])
|
||||||
server.append('systemctl')
|
server.append('systemctl')
|
||||||
try:
|
try:
|
||||||
@@ -281,6 +270,7 @@ def check_cinder_vg(config, messages):
|
|||||||
|
|
||||||
server.clear()
|
server.clear()
|
||||||
logging.info("A new cinder volumes group will be created")
|
logging.info("A new cinder volumes group will be created")
|
||||||
|
server.append('yum install -y lvm2')
|
||||||
|
|
||||||
cinders_volume_path = '/var/lib/cinder'
|
cinders_volume_path = '/var/lib/cinder'
|
||||||
server.append('mkdir -p %s' % cinders_volume_path)
|
server.append('mkdir -p %s' % cinders_volume_path)
|
||||||
@@ -348,11 +338,13 @@ def create_manifest(config, messages):
|
|||||||
manifestfile = "%s_cinder.pp" % config['CONFIG_CONTROLLER_HOST']
|
manifestfile = "%s_cinder.pp" % config['CONFIG_CONTROLLER_HOST']
|
||||||
manifestdata += getManifestTemplate("cinder.pp")
|
manifestdata += getManifestTemplate("cinder.pp")
|
||||||
|
|
||||||
if config['CONFIG_CINDER_BACKEND'] == "gluster":
|
if config['CONFIG_CINDER_BACKEND'] == "lvm":
|
||||||
|
manifestdata += getManifestTemplate("cinder_lvm.pp")
|
||||||
|
elif config['CONFIG_CINDER_BACKEND'] == "gluster":
|
||||||
manifestdata += getManifestTemplate("cinder_gluster.pp")
|
manifestdata += getManifestTemplate("cinder_gluster.pp")
|
||||||
if config['CONFIG_CINDER_BACKEND'] == "nfs":
|
elif config['CONFIG_CINDER_BACKEND'] == "nfs":
|
||||||
manifestdata += getManifestTemplate("cinder_nfs.pp")
|
manifestdata += getManifestTemplate("cinder_nfs.pp")
|
||||||
if config['CONFIG_CINDER_BACKEND'] == "vmdk":
|
elif config['CONFIG_CINDER_BACKEND'] == "vmdk":
|
||||||
manifestdata += getManifestTemplate("cinder_vmdk.pp")
|
manifestdata += getManifestTemplate("cinder_vmdk.pp")
|
||||||
if config['CONFIG_CEILOMETER_INSTALL'] == 'y':
|
if config['CONFIG_CEILOMETER_INSTALL'] == 'y':
|
||||||
manifestdata += getManifestTemplate('cinder_ceilometer.pp')
|
manifestdata += getManifestTemplate('cinder_ceilometer.pp')
|
||||||
|
|||||||
@@ -18,7 +18,3 @@ class {'cinder::scheduler':
|
|||||||
|
|
||||||
class {'cinder::volume':
|
class {'cinder::volume':
|
||||||
}
|
}
|
||||||
|
|
||||||
class {'cinder::volume::iscsi':
|
|
||||||
iscsi_ip_address => '%(CONFIG_CONTROLLER_HOST)s'
|
|
||||||
}
|
|
||||||
|
|||||||
9
packstack/puppet/templates/cinder_lvm.pp
Normal file
9
packstack/puppet/templates/cinder_lvm.pp
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
package { 'lvm2':
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
class {'cinder::volume::iscsi':
|
||||||
|
iscsi_ip_address => '%(CONFIG_CONTROLLER_HOST)s',
|
||||||
|
require => Package['lvm2'],
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user