Revert "Some configurations require IP address"
This reverts commit 713d1f4350d95b5eb145e51cd0d3bd325bf2ce17. this work is being done elsewhere
This commit is contained in:
parent
713d1f4350
commit
398cf93ef0
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import os, socket
|
import os
|
||||||
|
|
||||||
from packstack.installer import basedefs
|
from packstack.installer import basedefs
|
||||||
from packstack.installer.setup_controller import Controller
|
from packstack.installer.setup_controller import Controller
|
||||||
@ -73,16 +73,3 @@ def gethostlist(CONF):
|
|||||||
if host not in hosts:
|
if host not in hosts:
|
||||||
hosts.append(host)
|
hosts.append(host)
|
||||||
return hosts
|
return hosts
|
||||||
|
|
||||||
class PackStackException(BaseException):
|
|
||||||
def __init__(self, msg):
|
|
||||||
self.msg = msg
|
|
||||||
|
|
||||||
# return the ip address correcponding to a hostname
|
|
||||||
_ips = {}
|
|
||||||
def getIP(h):
|
|
||||||
if _ips.get(h):
|
|
||||||
return _ips.get(h)
|
|
||||||
_ips[h] = socket.gethostbyname(h)
|
|
||||||
return _ips[h]
|
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@ import logging
|
|||||||
import packstack.installer.engine_validators as validate
|
import packstack.installer.engine_validators as validate
|
||||||
import packstack.installer.common_utils as utils
|
import packstack.installer.common_utils as utils
|
||||||
|
|
||||||
from packstack.modules.ospluginutils import gethostlist, PackStackException, getIP
|
|
||||||
|
|
||||||
# Controller object will be initialized from main flow
|
# Controller object will be initialized from main flow
|
||||||
controller = None
|
controller = None
|
||||||
|
|
||||||
@ -104,40 +102,4 @@ def initConfig(controllerObject):
|
|||||||
controller.addGroup(groupDict, paramsList)
|
controller.addGroup(groupDict, paramsList)
|
||||||
|
|
||||||
def initSequences(controller):
|
def initSequences(controller):
|
||||||
preparesteps = [
|
pass
|
||||||
{'title': 'Sanitizing config variable', 'functions':[sanitize]}
|
|
||||||
]
|
|
||||||
controller.addSequence("Global", [], [], preparesteps)
|
|
||||||
|
|
||||||
# If either of localhost or 127.0.0.1 are anywhere in the list of hosts
|
|
||||||
# then this MUST be an all in one and all hosts MUST be loopback addresses
|
|
||||||
def dontMixloopback():
|
|
||||||
hosts = gethostlist(controller.CONF)
|
|
||||||
|
|
||||||
loopback = [h for h in hosts if h in ['127.0.0.1','localhost']]
|
|
||||||
if loopback:
|
|
||||||
if len(loopback) != len(hosts):
|
|
||||||
msg = "You must use 127.0.0.1 or localhost for All in One installs Only"
|
|
||||||
print msg
|
|
||||||
raise PackStackException(msg)
|
|
||||||
|
|
||||||
# Parts of the puppet modules MUST have IP addresses, we translate them here
|
|
||||||
# availableto templates so they are
|
|
||||||
def translateIPs():
|
|
||||||
hosts = []
|
|
||||||
for key,value in controller.CONF.items():
|
|
||||||
if key.endswith("_HOST"):
|
|
||||||
host = value.split('/')[0] # some host have devices in the name eg 1.1.1.1/vdb
|
|
||||||
controller.CONF[key.replace('_HOST','_IP')] = value.replace(host, getIP(host))
|
|
||||||
|
|
||||||
if key.endswith("_HOSTS"):
|
|
||||||
ips = []
|
|
||||||
for host_dev in value.split(","):
|
|
||||||
host_dev = host_dev.strip()
|
|
||||||
host = host_dev.split('/')[0]
|
|
||||||
ips.append(host_dev.replace(host, getIP(host)))
|
|
||||||
controller.CONF[key.replace('_HOSTS','_IPS')] = ','.join(ips)
|
|
||||||
|
|
||||||
def sanitize():
|
|
||||||
dontMixloopback()
|
|
||||||
translateIPs()
|
|
||||||
|
@ -80,11 +80,6 @@ def initSequences(controller):
|
|||||||
controller.addSequence("Installing MySQL", [], [], mysqlsteps)
|
controller.addSequence("Installing MySQL", [], [], mysqlsteps)
|
||||||
|
|
||||||
def createmanifest():
|
def createmanifest():
|
||||||
# If localhost is used for the MySQL server, then mysql makes a socket connection
|
|
||||||
# we change this to a IP to force it to use TCP
|
|
||||||
if controller.CONF.get('CONFIG_MYSQL_HOST') == 'localhost':
|
|
||||||
controller.CONF['CONFIG_MYSQL_HOST'] = '127.0.0.1'
|
|
||||||
|
|
||||||
manifestfile = "%s_mysql.pp"%controller.CONF['CONFIG_MYSQL_HOST']
|
manifestfile = "%s_mysql.pp"%controller.CONF['CONFIG_MYSQL_HOST']
|
||||||
manifestdata = getManifestTemplate("mysql.pp")
|
manifestdata = getManifestTemplate("mysql.pp")
|
||||||
appendManifestFile(manifestfile, manifestdata, 'pre')
|
appendManifestFile(manifestfile, manifestdata, 'pre')
|
||||||
|
@ -207,10 +207,8 @@ def createcertmanifest():
|
|||||||
appendManifestFile(manifestfile, manifestdata)
|
appendManifestFile(manifestfile, manifestdata)
|
||||||
|
|
||||||
def createcomputemanifest():
|
def createcomputemanifest():
|
||||||
compute_ip_list = controller.CONF["CONFIG_NOVA_COMPUTE_IPS"].split(",")
|
for host in controller.CONF["CONFIG_NOVA_COMPUTE_HOSTS"].split(","):
|
||||||
for i, host in enumerate(controller.CONF["CONFIG_NOVA_COMPUTE_HOSTS"].split(",")):
|
|
||||||
controller.CONF["CONFIG_NOVA_COMPUTE_HOST"] = host
|
controller.CONF["CONFIG_NOVA_COMPUTE_HOST"] = host
|
||||||
controller.CONF["CONFIG_NOVA_COMPUTE_IP"] = compute_ip_list[i]
|
|
||||||
manifestdata = getManifestTemplate("nova_compute.pp")
|
manifestdata = getManifestTemplate("nova_compute.pp")
|
||||||
manifestfile = "%s_nova.pp"%host
|
manifestfile = "%s_nova.pp"%host
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import packstack.installer.engine_validators as validate
|
|||||||
from packstack.installer import basedefs
|
from packstack.installer import basedefs
|
||||||
import packstack.installer.common_utils as utils
|
import packstack.installer.common_utils as utils
|
||||||
|
|
||||||
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile, manifestfiles, getIP
|
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile, manifestfiles
|
||||||
|
|
||||||
# Controller object will be initialized from main flow
|
# Controller object will be initialized from main flow
|
||||||
controller = None
|
controller = None
|
||||||
@ -26,8 +26,8 @@ def initConfig(controllerObject):
|
|||||||
logging.debug("Adding Openstack swift configuration")
|
logging.debug("Adding Openstack swift configuration")
|
||||||
paramsList = [
|
paramsList = [
|
||||||
{"CMD_OPTION" : "os-swift-proxy",
|
{"CMD_OPTION" : "os-swift-proxy",
|
||||||
"USAGE" : "The IP addresses on which to install the Swift proxy service",
|
"USAGE" : "A comma seperated list of IP addresses on which to install the Swift proxy services",
|
||||||
"PROMPT" : "The IP addresses on which to install the Swift proxy service",
|
"PROMPT" : "A comma seperated list of IP addresses on which to install the Swift proxy services",
|
||||||
"OPTION_LIST" : [],
|
"OPTION_LIST" : [],
|
||||||
"VALIDATION_FUNC" : validate.validatePing,
|
"VALIDATION_FUNC" : validate.validatePing,
|
||||||
"DEFAULT_VALUE" : "127.0.0.1",
|
"DEFAULT_VALUE" : "127.0.0.1",
|
||||||
@ -138,15 +138,14 @@ def createbuildermanifest():
|
|||||||
|
|
||||||
# Add each device to the ring
|
# Add each device to the ring
|
||||||
devicename = 0
|
devicename = 0
|
||||||
|
|
||||||
for device in parseDevices(controller.CONF["CONFIG_SWIFT_STORAGE_HOSTS"]):
|
for device in parseDevices(controller.CONF["CONFIG_SWIFT_STORAGE_HOSTS"]):
|
||||||
host = device['host']
|
host = device['host']
|
||||||
devicename = device['device_name']
|
devicename = device['device_name']
|
||||||
zone = device['zone']
|
zone = device['zone']
|
||||||
|
|
||||||
manifestdata = manifestdata + '\n@@ring_object_device { "%s:6000/%s":\n zone => %s,\n weight => 10, }'%(getIP(host), devicename, zone)
|
manifestdata = manifestdata + '\n@@ring_object_device { "%s:6000/%s":\n zone => %s,\n weight => 10, }'%(host, devicename, zone)
|
||||||
manifestdata = manifestdata + '\n@@ring_container_device { "%s:6001/%s":\n zone => %s,\n weight => 10, }'%(getIP(host), devicename, zone)
|
manifestdata = manifestdata + '\n@@ring_container_device { "%s:6001/%s":\n zone => %s,\n weight => 10, }'%(host, devicename, zone)
|
||||||
manifestdata = manifestdata + '\n@@ring_account_device { "%s:6002/%s":\n zone => %s,\n weight => 10, }'%(getIP(host), devicename, zone)
|
manifestdata = manifestdata + '\n@@ring_account_device { "%s:6002/%s":\n zone => %s,\n weight => 10, }'%(host, devicename, zone)
|
||||||
|
|
||||||
appendManifestFile(manifestfile, manifestdata, 'swiftbuilder')
|
appendManifestFile(manifestfile, manifestdata, 'swiftbuilder')
|
||||||
|
|
||||||
@ -162,7 +161,7 @@ def createstoragemanifest():
|
|||||||
|
|
||||||
# this need to happen once per storage host
|
# this need to happen once per storage host
|
||||||
for host in set([device['host'] for device in devices]):
|
for host in set([device['host'] for device in devices]):
|
||||||
controller.CONF["CONFIG_SWIFT_STORAGE_CURRENT"] = getIP(host)
|
controller.CONF["CONFIG_SWIFT_STORAGE_CURRENT"] = host
|
||||||
manifestfile = "%s_swift.pp"%host
|
manifestfile = "%s_swift.pp"%host
|
||||||
manifestdata = getManifestTemplate("swift_storage.pp")
|
manifestdata = getManifestTemplate("swift_storage.pp")
|
||||||
appendManifestFile(manifestfile, manifestdata)
|
appendManifestFile(manifestfile, manifestdata)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
nova_config{
|
nova_config{
|
||||||
"metadata_host": value => "%(CONFIG_NOVA_API_IP)s";
|
"metadata_host": value => "%(CONFIG_NOVA_API_HOST)s";
|
||||||
"qpid_hostname": value => "%(CONFIG_QPID_HOST)s";
|
"qpid_hostname": value => "%(CONFIG_QPID_HOST)s";
|
||||||
"rpc_backend": value => "nova.rpc.impl_qpid";
|
"rpc_backend": value => "nova.rpc.impl_qpid";
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
nova_config{
|
nova_config{
|
||||||
"network_host": value => "%(CONFIG_NOVA_NETWORK_IP)s";
|
"network_host": value => "%(CONFIG_NOVA_NETWORK_HOST)s";
|
||||||
"libvirt_inject_partition": value => "-1";
|
"libvirt_inject_partition": value => "-1";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ class {"nova::compute":
|
|||||||
|
|
||||||
class { 'nova::compute::libvirt':
|
class { 'nova::compute::libvirt':
|
||||||
libvirt_type => "%(CONFIG_LIBVIRT_TYPE)s",
|
libvirt_type => "%(CONFIG_LIBVIRT_TYPE)s",
|
||||||
vncserver_listen => "%(CONFIG_NOVA_COMPUTE_IP)s",
|
vncserver_listen => "%(CONFIG_NOVA_COMPUTE_HOST)s",
|
||||||
}
|
}
|
||||||
|
|
||||||
if "%(CONFIG_LIBVIRT_TYPE)s" == "qemu" and $::operatingsystem == "RedHat" {
|
if "%(CONFIG_LIBVIRT_TYPE)s" == "qemu" and $::operatingsystem == "RedHat" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user