diff --git a/docs/packstack.rst b/docs/packstack.rst index 6b50ff48f..26c465c52 100644 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -87,13 +87,13 @@ Global Options Specify 'y' if you want to run OpenStack services in debug mode; otherwise, specify 'n'. ['y', 'n'] **CONFIG_CONTROLLER_HOST** - IP address of the server on which to install OpenStack services specific to the controller role (for example, API servers or dashboard). + Server on which to install OpenStack services specific to the controller role (for example, API servers or dashboard). **CONFIG_COMPUTE_HOSTS** - List of IP addresses of the servers on which to install the Compute service. + List the servers on which to install the Compute service. **CONFIG_NETWORK_HOSTS** - List of IP addresses of the server on which to install the network service such as Compute networking (nova network) or OpenStack Networking (neutron). + List of servers on which to install the network service such as Compute networking (nova network) or OpenStack Networking (neutron). **CONFIG_VMWARE_BACKEND** Specify 'y' if you want to use VMware vCenter as hypervisor and storage; otherwise, specify 'n'. ['y', 'n'] @@ -160,10 +160,10 @@ Global unsupported options -------------------------- **CONFIG_STORAGE_HOST** - (Unsupported!) IP address of the server on which to install OpenStack services specific to storage servers such as Image or Block Storage services. + (Unsupported!) Server on which to install OpenStack services specific to storage servers such as Image or Block Storage services. **CONFIG_SAHARA_HOST** - (Unsupported!) IP address of the server on which to install OpenStack services specific to OpenStack Data Processing (sahara). + (Unsupported!) Server on which to install OpenStack services specific to OpenStack Data Processing (sahara). Server Prepare Configs ----------------------- diff --git a/packstack/installer/utils/network.py b/packstack/installer/utils/network.py index bfe4bc072..f87e1d9e6 100644 --- a/packstack/installer/utils/network.py +++ b/packstack/installer/utils/network.py @@ -20,6 +20,7 @@ except ImportError: import re import socket +import logging from ..exceptions import NetworkError from .shell import execute from .shell import ScriptRunner @@ -57,23 +58,34 @@ def get_localhost_ip(): 'nameserver correctly.') +_host_cache = {} + + def host2ip(hostname, allow_localhost=False): """ Converts given hostname to IP address. Raises NetworkError if conversion failed. """ + key = '{}:{}'.format(hostname, allow_localhost) + if key in _host_cache: + return _host_cache[key] try: - ip_list = socket.gethostbyaddr(hostname)[2] + ip_list = list(sockets[4][0] for sockets in + socket.getaddrinfo(hostname, 22, 0, 0, socket.IPPROTO_TCP)) + if allow_localhost: - return ip_list[0] + ip = ip_list[0] else: - local_ips = ('127.0.0.1', '::1') - for ip in ip_list: - if ip not in local_ips: - break - else: - raise NameError() - return ip + routable = [ip for ip in ip_list if ip not in ('127.0.0.1', '::1')] + if not routable: + raise NameError("Host %s is not routable, please fix" + "your /etc/hosts", host) + if len(routable) > 1: + logging.warn("Multiple IPs for host detected!") + ip = routable[0] + + _host_cache[key] = ip + return ip except NameError: # given hostname is localhost, return appropriate IP address return get_localhost_ip() @@ -92,7 +104,7 @@ def is_ipv6(host): try: return netaddr.IPAddress(host).version == 6 except netaddr.core.AddrFormatError: - # Most probably a hostname, no need for bracket everywhere. + # Most probably a hostname return False @@ -105,7 +117,8 @@ def is_ipv4(host): try: return netaddr.IPAddress(host).version == 4 except netaddr.core.AddrFormatError: - return True + # Most probably a hostname + return False def force_ip(host, allow_localhost=False): diff --git a/packstack/installer/validators.py b/packstack/installer/validators.py index b6ae06c12..9024769b5 100644 --- a/packstack/installer/validators.py +++ b/packstack/installer/validators.py @@ -254,10 +254,9 @@ def touch_port(host, port): key = "%s:%d" % (host, port) if key in _tested_ports: return - s = socket.socket(validate_ip(host), socket.SOCK_STREAM) - s.connect((host, port)) - s.shutdown(socket.SHUT_RDWR) - s.close() + sock = socket.create_connection((host, port)) + sock.shutdown(socket.SHUT_RDWR) + sock.close() _tested_ports.append(key) diff --git a/packstack/plugins/amqp_002.py b/packstack/plugins/amqp_002.py index d73a2f7a5..86bdc589f 100644 --- a/packstack/plugins/amqp_002.py +++ b/packstack/plugins/amqp_002.py @@ -50,7 +50,7 @@ def initConfig(controller): "DEPRECATES": ['CONFIG_AMQP_SERVER']}, {"CMD_OPTION": "amqp-host", - "PROMPT": "Enter the IP address of the AMQP service", + "PROMPT": "Enter the host for the AMQP service", "OPTION_LIST": [], "VALIDATORS": [validators.validate_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), diff --git a/packstack/plugins/ceilometer_800.py b/packstack/plugins/ceilometer_800.py index c6b92a838..c8cedeaa9 100644 --- a/packstack/plugins/ceilometer_800.py +++ b/packstack/plugins/ceilometer_800.py @@ -79,7 +79,7 @@ def initConfig(controller): "MONGODB": [ {"CMD_OPTION": "mongodb-host", - "PROMPT": "Enter the IP address of the MongoDB server", + "PROMPT": "Enter the host for the MongoDB server", "OPTION_LIST": [], "VALIDATORS": [validators.validate_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), @@ -92,7 +92,7 @@ def initConfig(controller): ], "REDIS": [ {"CMD_OPTION": "redis-master-host", - "PROMPT": "Enter the IP address of the redis master server", + "PROMPT": "Enter the host for the Redis master server", "OPTION_LIST": [], "VALIDATORS": [validators.validate_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), @@ -126,7 +126,7 @@ def initConfig(controller): "NEED_CONFIRM": False, "CONDITION": False}, {"CMD_OPTION": "redis-slaves", - "PROMPT": "Enter the IP addresses of the redis slave servers", + "PROMPT": "Enter the host for the redis slave servers", "OPTION_LIST": [], "VALIDATORS": [validators.validate_multi_ssh], "DEFAULT_VALUE": "", @@ -137,7 +137,7 @@ def initConfig(controller): "NEED_CONFIRM": False, "CONDITION": False}, {"CMD_OPTION": "redis-sentinels", - "PROMPT": "Enter the IP addresses of the redis sentinel servers", + "PROMPT": "Enter the host for the redis sentinel servers", "OPTION_LIST": [], "VALIDATORS": [validators.validate_multi_ssh], "DEFAULT_VALUE": "", diff --git a/packstack/plugins/prescript_000.py b/packstack/plugins/prescript_000.py index b95fd8341..09d95ab4b 100644 --- a/packstack/plugins/prescript_000.py +++ b/packstack/plugins/prescript_000.py @@ -331,10 +331,9 @@ def initConfig(controller): {"CONF_NAME": "CONFIG_CONTROLLER_HOST", "CMD_OPTION": "os-controller-host", - "PROMPT": "Enter the IP address of the controller host", + "PROMPT": "Enter the controller host", "OPTION_LIST": [], - "VALIDATORS": [validators.validate_ip, - validators.validate_ssh], + "VALIDATORS": [validators.validate_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), "MASK_INPUT": False, "LOOSE_VALIDATION": False, @@ -360,13 +359,9 @@ def initConfig(controller): {"CONF_NAME": "CONFIG_COMPUTE_HOSTS", "CMD_OPTION": "os-compute-hosts", - "PROMPT": ( - "Enter list of IP addresses on which to install compute " - "service" - ), + "PROMPT": "Enter list of compute hosts", "OPTION_LIST": [], - "VALIDATORS": [validators.validate_multi_ip, - validators.validate_multi_ssh], + "VALIDATORS": [validators.validate_multi_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), "MASK_INPUT": False, "LOOSE_VALIDATION": False, @@ -377,11 +372,9 @@ def initConfig(controller): {"CONF_NAME": "CONFIG_NETWORK_HOSTS", "CMD_OPTION": "os-network-hosts", - "PROMPT": ("Enter list of IP addresses on which to install " - "network service"), + "PROMPT": "Enter list of network hosts", "OPTION_LIST": [], - "VALIDATORS": [validators.validate_multi_ip, - validators.validate_multi_ssh], + "VALIDATORS": [validators.validate_multi_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), "MASK_INPUT": False, "LOOSE_VALIDATION": False, @@ -504,10 +497,9 @@ def initConfig(controller): "UNSUPPORTED": [ {"CONF_NAME": "CONFIG_STORAGE_HOST", "CMD_OPTION": "os-storage-host", - "PROMPT": "Enter the IP address of the storage host", + "PROMPT": "Enter the host for the storage services", "OPTION_LIST": [], - "VALIDATORS": [validators.validate_ip, - validators.validate_ssh], + "VALIDATORS": [validators.validate_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), "MASK_INPUT": False, "LOOSE_VALIDATION": False, @@ -517,10 +509,9 @@ def initConfig(controller): {"CONF_NAME": "CONFIG_SAHARA_HOST", "CMD_OPTION": "os-sahara-host", - "PROMPT": "Enter the IP address of the Sahara host", + "PROMPT": "Enter the host for the Sahara", "OPTION_LIST": [], - "VALIDATORS": [validators.validate_ip, - validators.validate_ssh], + "VALIDATORS": [validators.validate_ssh], "DEFAULT_VALUE": utils.get_localhost_ip(), "MASK_INPUT": False, "LOOSE_VALIDATION": False, @@ -1153,20 +1144,30 @@ def manage_rdo(host, config): def choose_ip_version(config, messages): - use_ipv6 = False - use_ipv4 = False + use_ipv6 = None + use_ipv4 = None for hostname in filtered_hosts(config): if '/' in hostname: hostname = hostname.split('/')[0] - use_ipv6 |= utils.network.is_ipv6(hostname) - use_ipv4 |= utils.network.is_ipv4(hostname) + if use_ipv6 is None and use_ipv4 is None: + use_ipv6 = utils.network.is_ipv6(hostname) + use_ipv4 = utils.network.is_ipv4(hostname) + # check consistency + if (use_ipv6 and not utils.network.is_ipv6(hostname) or + use_ipv4 and not utils.network.is_ipv4(hostname)): + raise ValueError( + "Inconsistent host format. Please use either IPv4 addresses, " + "IPv6 adresses or hostnames for all host variables. " + ) if use_ipv6 and use_ipv4: msg = "IPv6 together with IPv4 installation is not supported" raise exceptions.ParamValidationError(msg) elif use_ipv6: config['CONFIG_IP_VERSION'] = 'ipv6' - else: + elif use_ipv4: config['CONFIG_IP_VERSION'] = 'ipv4' + else: + config['CONFIG_IP_VERSION'] = 'none' def install_keys_on_host(hostname, sshkeydata): diff --git a/packstack/plugins/swift_600.py b/packstack/plugins/swift_600.py index afbd367ac..a2a92a4e6 100644 --- a/packstack/plugins/swift_600.py +++ b/packstack/plugins/swift_600.py @@ -260,6 +260,8 @@ def create_builder_manifest(config, messages): # come up. Specifically the replicator crashes if the ring isn't present def device_def(dev_type, host, dev_port, devicename, zone): + # device host has to be IP address + host = utils.force_ip(host) fmt = ('\n@@%s { "%s:%s/%s":\n' ' zone => %s,\n' ' weight => 10, }\n') diff --git a/packstack/puppet/modules/packstack/lib/puppet/parser/functions/force_ip.rb b/packstack/puppet/modules/packstack/lib/puppet/parser/functions/force_ip.rb new file mode 100644 index 000000000..2c8a31f42 --- /dev/null +++ b/packstack/puppet/modules/packstack/lib/puppet/parser/functions/force_ip.rb @@ -0,0 +1,15 @@ + +require 'resolv' + + +module Puppet::Parser::Functions + newfunction(:force_ip, :type => :rvalue) do |args| + if args.size < 1 + raise( + Puppet::ParseError, + "force_ip(): Wrong number of arguments given (#{args.size} for 1)" + ) + end + Resolv.getaddress args[0] + end +end diff --git a/packstack/puppet/modules/packstack/manifests/firewall.pp b/packstack/puppet/modules/packstack/manifests/firewall.pp index 400a34904..fd4c014a1 100644 --- a/packstack/puppet/modules/packstack/manifests/firewall.pp +++ b/packstack/puppet/modules/packstack/manifests/firewall.pp @@ -13,8 +13,8 @@ define packstack::firewall ( $provider = $ip_version ? { 'ipv6' => 'ip6tables', - 'ipv4' => 'iptables', - default => fail("IP version cannot be ${ip_version}") + default => 'iptables', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } $source = $host ? { diff --git a/packstack/puppet/templates/ceilometer.pp b/packstack/puppet/templates/ceilometer.pp index 05c0d8c13..78a593327 100644 --- a/packstack/puppet/templates/ceilometer.pp +++ b/packstack/puppet/templates/ceilometer.pp @@ -50,8 +50,9 @@ class { '::ceilometer::alarm::evaluator': } $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::ceilometer::api': host => $bind_host, diff --git a/packstack/puppet/templates/cinder.pp b/packstack/puppet/templates/cinder.pp index 59867fe6b..ab1342de2 100644 --- a/packstack/puppet/templates/cinder.pp +++ b/packstack/puppet/templates/cinder.pp @@ -3,8 +3,9 @@ cinder_config { } $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::cinder::api': diff --git a/packstack/puppet/templates/glance.pp b/packstack/puppet/templates/glance.pp index ee4aa0e73..3506cd285 100644 --- a/packstack/puppet/templates/glance.pp +++ b/packstack/puppet/templates/glance.pp @@ -4,13 +4,15 @@ $glance_cfg_ctrl_host = hiera('CONFIG_KEYSTONE_HOST_URL') # glance option bind_host requires address without brackets $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } # magical hack for magical config - glance option registry_host requires brackets $registry_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '[::0]', - 'ipv4' => '0.0.0.0', + 'ipv6' => '[::0]', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::glance::api': diff --git a/packstack/puppet/templates/horizon.pp b/packstack/puppet/templates/horizon.pp index 7db7bb74d..f9268bb89 100644 --- a/packstack/puppet/templates/horizon.pp +++ b/packstack/puppet/templates/horizon.pp @@ -11,8 +11,9 @@ $is_django_debug = hiera('CONFIG_DEBUG_MODE') ? { } $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } $horizon_ssl = hiera('CONFIG_HORIZON_SSL') ? { @@ -55,8 +56,9 @@ if hiera('CONFIG_KEYSTONE_SERVICE_NAME') == 'httpd' { # hack for memcached, for now we bind to localhost on ipv6 # https://bugzilla.redhat.com/show_bug.cgi?id=1210658 $memcached_bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => 'localhost6', - 'ipv4' => '0.0.0.0', + 'ipv6' => 'localhost6', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::memcached': diff --git a/packstack/puppet/templates/keystone.pp b/packstack/puppet/templates/keystone.pp index 411b80d9d..f656b84a9 100644 --- a/packstack/puppet/templates/keystone.pp +++ b/packstack/puppet/templates/keystone.pp @@ -7,8 +7,9 @@ $keystone_admin_url = hiera('CONFIG_KEYSTONE_ADMIN_URL') $keystone_api_version = hiera('CONFIG_KEYSTONE_API_VERSION') $keystone_versioned_admin_url = "${keystone_admin_url}/${keystone_api_version}" $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } if hiera('CONFIG_KEYSTONE_SERVICE_NAME') == 'keystone' { diff --git a/packstack/puppet/templates/manila.pp b/packstack/puppet/templates/manila.pp index 6ba974b8d..c9af631f0 100644 --- a/packstack/puppet/templates/manila.pp +++ b/packstack/puppet/templates/manila.pp @@ -3,8 +3,9 @@ manila_config { } $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::manila::api': diff --git a/packstack/puppet/templates/mariadb_install.pp b/packstack/puppet/templates/mariadb_install.pp index 286f04523..331adb4de 100644 --- a/packstack/puppet/templates/mariadb_install.pp +++ b/packstack/puppet/templates/mariadb_install.pp @@ -5,8 +5,9 @@ package { 'mariadb-server': } $bind_address = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } # hack around galera packaging issue, they are duplicating @@ -52,4 +53,3 @@ if ($::fqdn != $::hostname and $::hostname != 'localhost') { require => Class['mysql::server'], } } - diff --git a/packstack/puppet/templates/mongodb.pp b/packstack/puppet/templates/mongodb.pp index 3b1a83a98..446a0cbc0 100644 --- a/packstack/puppet/templates/mongodb.pp +++ b/packstack/puppet/templates/mongodb.pp @@ -14,9 +14,9 @@ class { '::mongodb::server': ipv6 => hiera('CONFIG_IP_VERSION') ? { 'ipv6' => true, default => false, + # TO-DO(mmagr): Add IPv6 support when hostnames are used }, smallfiles => true, - bind_ip => $mongodb_host, + bind_ip => force_ip($mongodb_host), config => $config_file, } - diff --git a/packstack/puppet/templates/neutron_metadata.pp b/packstack/puppet/templates/neutron_metadata.pp index 8e1c29058..9205c49fd 100644 --- a/packstack/puppet/templates/neutron_metadata.pp +++ b/packstack/puppet/templates/neutron_metadata.pp @@ -3,6 +3,6 @@ class { '::neutron::agents::metadata': auth_url => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), auth_region => hiera('CONFIG_KEYSTONE_REGION'), shared_secret => hiera('CONFIG_NEUTRON_METADATA_PW'), - metadata_ip => hiera('CONFIG_KEYSTONE_HOST_URL'), + metadata_ip => force_ip(hiera('CONFIG_KEYSTONE_HOST_URL')), debug => hiera('CONFIG_DEBUG_MODE'), } diff --git a/packstack/puppet/templates/neutron_ovs_agent.pp b/packstack/puppet/templates/neutron_ovs_agent.pp index 0476a8b68..67e40f800 100644 --- a/packstack/puppet/templates/neutron_ovs_agent.pp +++ b/packstack/puppet/templates/neutron_ovs_agent.pp @@ -18,7 +18,7 @@ class { '::neutron::agents::ml2::ovs': bridge_mappings => hiera_array('CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS'), enable_tunneling => hiera('CONFIG_NEUTRON_OVS_TUNNELING'), tunnel_types => hiera_array('CONFIG_NEUTRON_OVS_TUNNEL_TYPES'), - local_ip => $localip, + local_ip => force_ip($localip), vxlan_udp_port => hiera('CONFIG_NEUTRON_OVS_VXLAN_UDP_PORT',undef), l2_population => hiera('CONFIG_NEUTRON_USE_L2POPULATION'), } diff --git a/packstack/puppet/templates/neutron_qpid.pp b/packstack/puppet/templates/neutron_qpid.pp index 892cad891..3513b5599 100644 --- a/packstack/puppet/templates/neutron_qpid.pp +++ b/packstack/puppet/templates/neutron_qpid.pp @@ -1,6 +1,7 @@ $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::neutron': diff --git a/packstack/puppet/templates/neutron_rabbitmq.pp b/packstack/puppet/templates/neutron_rabbitmq.pp index 434a7a79b..9e2f0c67b 100644 --- a/packstack/puppet/templates/neutron_rabbitmq.pp +++ b/packstack/puppet/templates/neutron_rabbitmq.pp @@ -1,6 +1,7 @@ $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } $kombu_ssl_ca_certs = hiera('CONFIG_AMQP_SSL_CACERT_FILE', undef) diff --git a/packstack/puppet/templates/nova_api.pp b/packstack/puppet/templates/nova_api.pp index 7587c1095..31882c259 100644 --- a/packstack/puppet/templates/nova_api.pp +++ b/packstack/puppet/templates/nova_api.pp @@ -1,8 +1,9 @@ require 'keystone::python' $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } $config_use_neutron = hiera('CONFIG_NEUTRON_INSTALL') diff --git a/packstack/puppet/templates/nova_common_pw.pp b/packstack/puppet/templates/nova_common_pw.pp index 67bb1d1ba..68ef5ea7a 100644 --- a/packstack/puppet/templates/nova_common_pw.pp +++ b/packstack/puppet/templates/nova_common_pw.pp @@ -4,5 +4,6 @@ Firewall <| |> -> Class['nova'] nova_config{ 'DEFAULT/sql_connection': value => hiera('CONFIG_NOVA_SQL_CONN_PW'); - 'DEFAULT/metadata_host': value => hiera('CONFIG_CONTROLLER_HOST'); + # metadata_host has to be IP + 'DEFAULT/metadata_host': value => force_ip(hiera('CONFIG_CONTROLLER_HOST')); } diff --git a/packstack/puppet/templates/nova_compute_libvirt.pp b/packstack/puppet/templates/nova_compute_libvirt.pp index 01de52648..3eb677054 100644 --- a/packstack/puppet/templates/nova_compute_libvirt.pp +++ b/packstack/puppet/templates/nova_compute_libvirt.pp @@ -19,8 +19,9 @@ exec { 'qemu-kvm': } $libvirt_vnc_bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::nova::compute::libvirt': diff --git a/packstack/puppet/templates/nova_vncproxy.pp b/packstack/puppet/templates/nova_vncproxy.pp index 1d0dab79a..e8c5d718f 100644 --- a/packstack/puppet/templates/nova_vncproxy.pp +++ b/packstack/puppet/templates/nova_vncproxy.pp @@ -7,8 +7,9 @@ if hiera('CONFIG_HORIZON_SSL') == 'y' { } $vnc_bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::nova::vncproxy': @@ -25,4 +26,3 @@ firewall { '001 novncproxy incoming': dport => ['6080'], action => 'accept', } - diff --git a/packstack/puppet/templates/swift_proxy.pp b/packstack/puppet/templates/swift_proxy.pp index 07d034c7b..6e20cdc0c 100644 --- a/packstack/puppet/templates/swift_proxy.pp +++ b/packstack/puppet/templates/swift_proxy.pp @@ -2,15 +2,17 @@ package { 'curl': ensure => present } $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } # hack for memcached, for now we bind to localhost on ipv6 # https://bugzilla.redhat.com/show_bug.cgi?id=1210658 $memcached_bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => 'localhost6', - 'ipv4' => '0.0.0.0', + 'ipv6' => 'localhost6', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::memcached': diff --git a/packstack/puppet/templates/trove.pp b/packstack/puppet/templates/trove.pp index d1d30ffab..970c97085 100644 --- a/packstack/puppet/templates/trove.pp +++ b/packstack/puppet/templates/trove.pp @@ -1,6 +1,7 @@ $bind_host = hiera('CONFIG_IP_VERSION') ? { - 'ipv6' => '::0', - 'ipv4' => '0.0.0.0', + 'ipv6' => '::0', + default => '0.0.0.0', + # TO-DO(mmagr): Add IPv6 support when hostnames are used } class { '::trove::api':