Consolidate IP address configuration
There are several IP address / hostname related configs (i.e. api.host_ip, docker.docker_remote_api_host, websocket_proxy.wsproxy_host) that required manual configuration by operators. Normally, these configs are default as local IP / hostname. It is undesirable for operators to tune all these configs repeatedly. Let's consolidate all these configurations into two defaults: * [DEFAULT] my_ip: The IP address which the host is using to connect to the * management network. * [DEFAULT] host: Hostname, FQDN or IP address of this host. Change-Id: Ie26578c4208a79e4306b1006c6b316a41c2b3540 Closes-Bug: #1723515
This commit is contained in:
parent
761d1318b4
commit
b64fdd331e
@ -18,8 +18,10 @@ api_service_opts = [
|
|||||||
default=9517,
|
default=9517,
|
||||||
help='The port for the zun API server.'),
|
help='The port for the zun API server.'),
|
||||||
cfg.IPOpt('host_ip',
|
cfg.IPOpt('host_ip',
|
||||||
default='127.0.0.1',
|
default='$my_ip',
|
||||||
help='The listen IP for the zun API server.'),
|
help="The listen IP for the zun API server. "
|
||||||
|
"The default is ``$my_ip``, "
|
||||||
|
"the IP address of this host."),
|
||||||
cfg.BoolOpt('enable_ssl_api',
|
cfg.BoolOpt('enable_ssl_api',
|
||||||
default=False,
|
default=False,
|
||||||
help="Enable the integrated stand-alone API to service "
|
help="Enable the integrated stand-alone API to service "
|
||||||
|
@ -31,9 +31,10 @@ sql_opts = [
|
|||||||
|
|
||||||
etcd_opts = [
|
etcd_opts = [
|
||||||
cfg.HostAddressOpt('etcd_host',
|
cfg.HostAddressOpt('etcd_host',
|
||||||
default='127.0.0.1',
|
default='$my_ip',
|
||||||
help="Host IP address on which etcd service "
|
help="Host IP address on which etcd service "
|
||||||
"running."),
|
"running. The default is ``$my_ip``, "
|
||||||
|
"the IP address of this host."),
|
||||||
cfg.PortOpt('etcd_port',
|
cfg.PortOpt('etcd_port',
|
||||||
default=2379,
|
default=2379,
|
||||||
help="Port on which etcd listen client request.")
|
help="Port on which etcd listen client request.")
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import socket
|
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
docker_group = cfg.OptGroup(name='docker',
|
docker_group = cfg.OptGroup(name='docker',
|
||||||
@ -46,8 +44,7 @@ docker_opts = [
|
|||||||
help='Location of TLS private key file for '
|
help='Location of TLS private key file for '
|
||||||
'securing docker api requests (tlskey).'),
|
'securing docker api requests (tlskey).'),
|
||||||
cfg.StrOpt('docker_remote_api_host',
|
cfg.StrOpt('docker_remote_api_host',
|
||||||
default=socket.gethostname(),
|
default='$my_ip',
|
||||||
sample_default='localhost',
|
|
||||||
help='Defines the remote api host for the docker daemon.'),
|
help='Defines the remote api host for the docker daemon.'),
|
||||||
cfg.StrOpt('docker_remote_api_port',
|
cfg.StrOpt('docker_remote_api_port',
|
||||||
default='2375',
|
default='2375',
|
||||||
|
@ -11,13 +11,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import socket
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import netutils
|
from oslo_utils import netutils
|
||||||
|
|
||||||
|
|
||||||
netconf_opts = [
|
netconf_opts = [
|
||||||
cfg.StrOpt("my_ip",
|
cfg.StrOpt('my_ip',
|
||||||
default=netutils.get_my_ipv4(),
|
default=netutils.get_my_ipv4(),
|
||||||
|
sample_default='<host_ipv4>',
|
||||||
help="""
|
help="""
|
||||||
The IP address which the host is using to connect to the management network.
|
The IP address which the host is using to connect to the management network.
|
||||||
|
|
||||||
@ -27,30 +30,40 @@ Possible values:
|
|||||||
|
|
||||||
Related options:
|
Related options:
|
||||||
|
|
||||||
|
* docker_remote_api_host
|
||||||
|
* etcd_host
|
||||||
|
* wsproxy_host
|
||||||
|
* host_ip
|
||||||
* my_block_storage_ip
|
* my_block_storage_ip
|
||||||
|
"""),
|
||||||
|
cfg.StrOpt('host',
|
||||||
|
default=socket.gethostname(),
|
||||||
|
sample_default='<current_hostname>',
|
||||||
|
help="""
|
||||||
|
Hostname, FQDN or IP address of this host. This can be an opaque identifier.
|
||||||
|
It is not necessarily a hostname, FQDN, or IP address. However, the node name
|
||||||
|
must be valid within an AMQP key, and if using ZeroMQ, a valid hostname,
|
||||||
|
FQDN, or IP address.
|
||||||
|
|
||||||
|
Possible values:
|
||||||
|
|
||||||
|
* String with hostname, FQDN or IP address. Default is hostname of this host.
|
||||||
"""),
|
"""),
|
||||||
cfg.StrOpt("my_block_storage_ip",
|
cfg.StrOpt("my_block_storage_ip",
|
||||||
default="$my_ip",
|
default="$my_ip",
|
||||||
help="""
|
help="""
|
||||||
The IP address which is used to connect to the block storage network.
|
The IP address which is used to connect to the block storage network.
|
||||||
|
|
||||||
Possible values:
|
Possible values:
|
||||||
|
|
||||||
* String with valid IP address. Default is IP address of this host.
|
* String with valid IP address. Default is IP address of this host.
|
||||||
|
|
||||||
Related options:
|
Related options:
|
||||||
|
|
||||||
* my_ip - if my_block_storage_ip is not set, then my_ip value is used.
|
* my_ip - if my_block_storage_ip is not set, then my_ip value is used.
|
||||||
"""),
|
"""),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
ALL_OPTS = (netconf_opts)
|
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
conf.register_opts(ALL_OPTS)
|
conf.register_opts(netconf_opts)
|
||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
return {"DEFAULT": ALL_OPTS}
|
return {'DEFAULT': netconf_opts}
|
||||||
|
@ -14,23 +14,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import socket
|
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
|
||||||
service_opts = [
|
|
||||||
cfg.HostAddressOpt('host',
|
|
||||||
default=socket.gethostname(),
|
|
||||||
sample_default='localhost',
|
|
||||||
help='Name of this node. This can be an '
|
|
||||||
'opaque identifier. It is not necessarily '
|
|
||||||
'a hostname, FQDN, or IP address. '
|
|
||||||
'However, the node name must be valid '
|
|
||||||
'within an AMQP key, and if using ZeroMQ, '
|
|
||||||
'a valid hostname, FQDN, or IP address.'),
|
|
||||||
]
|
|
||||||
|
|
||||||
periodic_opts = [
|
periodic_opts = [
|
||||||
cfg.IntOpt('periodic_interval_max',
|
cfg.IntOpt('periodic_interval_max',
|
||||||
default=60,
|
default=60,
|
||||||
@ -42,7 +28,7 @@ periodic_opts = [
|
|||||||
'seconds.'),
|
'seconds.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
ALL_OPTS = (service_opts + periodic_opts)
|
ALL_OPTS = (periodic_opts)
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
|
@ -38,7 +38,7 @@ Related options:
|
|||||||
* The port must be the same as ``wsproxy_port``in this section.
|
* The port must be the same as ``wsproxy_port``in this section.
|
||||||
"""),
|
"""),
|
||||||
cfg.StrOpt('wsproxy_host',
|
cfg.StrOpt('wsproxy_host',
|
||||||
default='127.0.0.1',
|
default='$my_ip',
|
||||||
help="""
|
help="""
|
||||||
The IP address which is used by the ``zun-wsproxy`` service to listen
|
The IP address which is used by the ``zun-wsproxy`` service to listen
|
||||||
for incoming requests.
|
for incoming requests.
|
||||||
|
@ -20,7 +20,7 @@ from oslo_config import cfg
|
|||||||
from zun.common import config
|
from zun.common import config
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
CONF.import_opt('host', 'zun.common.service')
|
CONF.import_opt('host', 'zun.conf')
|
||||||
CONF.import_opt('connection', 'oslo_db.options', group='database')
|
CONF.import_opt('connection', 'oslo_db.options', group='database')
|
||||||
CONF.import_opt('sqlite_synchronous', 'oslo_db.options', group='database')
|
CONF.import_opt('sqlite_synchronous', 'oslo_db.options', group='database')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user