Set lock_path correctly.
[openstack-build/neutron-build.git] / neutron / agent / dhcp / config.py
1 # Copyright 2015 OpenStack Foundation
2 #
3 # All Rights Reserved.
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
6 #    not use this file except in compliance with the License. You may obtain
7 #    a copy of the License at
8 #
9 #         http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 #    License for the specific language governing permissions and limitations
15 #    under the License.
16
17 from oslo_config import cfg
18
19 from neutron._i18n import _
20
21 DHCP_AGENT_OPTS = [
22     cfg.IntOpt('resync_interval', default=5,
23                help=_("The DHCP agent will resync its state with Neutron to "
24                       "recover from any transient notification or RPC errors. "
25                       "The interval is number of seconds between attempts.")),
26     cfg.StrOpt('dhcp_driver',
27                default='neutron.agent.linux.dhcp.Dnsmasq',
28                help=_("The driver used to manage the DHCP server.")),
29     cfg.BoolOpt('enable_isolated_metadata', default=False,
30                 help=_("The DHCP server can assist with providing metadata "
31                        "support on isolated networks. Setting this value to "
32                        "True will cause the DHCP server to append specific "
33                        "host routes to the DHCP request. The metadata service "
34                        "will only be activated when the subnet does not "
35                        "contain any router port. The guest instance must be "
36                        "configured to request host routes via DHCP (Option "
37                        "121). This option doesn't have any effect when "
38                        "force_metadata is set to True.")),
39     cfg.BoolOpt('force_metadata', default=False,
40                 help=_("In some cases the Neutron router is not present to "
41                        "provide the metadata IP but the DHCP server can be "
42                        "used to provide this info. Setting this value will "
43                        "force the DHCP server to append specific host routes "
44                        "to the DHCP request. If this option is set, then the "
45                        "metadata service will be activated for all the "
46                        "networks.")),
47     cfg.BoolOpt('enable_metadata_network', default=False,
48                 help=_("Allows for serving metadata requests coming from a "
49                        "dedicated metadata access network whose CIDR is "
50                        "169.254.169.254/16 (or larger prefix), and is "
51                        "connected to a Neutron router from which the VMs send "
52                        "metadata:1 request. In this case DHCP Option 121 will "
53                        "not be injected in VMs, as they will be able to reach "
54                        "169.254.169.254 through a router. This option "
55                        "requires enable_isolated_metadata = True.")),
56     cfg.IntOpt('num_sync_threads', default=4,
57                help=_('Number of threads to use during sync process. '
58                       'Should not exceed connection pool size configured on '
59                       'server.'))
60 ]
61
62 DHCP_OPTS = [
63     cfg.StrOpt('dhcp_confs',
64                default='$state_path/dhcp',
65                help=_('Location to store DHCP server config files')),
66     cfg.StrOpt('dhcp_domain',
67                default='openstacklocal',
68                help=_('Domain to use for building the hostnames.'
69                       'This option is deprecated. It has been moved to '
70                       'neutron.conf as dns_domain. It will removed from here '
71                       'in a future release'),
72                deprecated_for_removal=True),
73 ]
74
75 DNSMASQ_OPTS = [
76     cfg.StrOpt('dnsmasq_config_file',
77                default='',
78                help=_('Override the default dnsmasq settings with this file')),
79     cfg.ListOpt('dnsmasq_dns_servers',
80                 help=_('Comma-separated list of the DNS servers which will be '
81                        'used as forwarders.'),
82                 deprecated_name='dnsmasq_dns_server'),
83     cfg.StrOpt('dnsmasq_base_log_dir',
84                help=_("Base log dir for dnsmasq logging. "
85                       "The log contains DHCP and DNS log information and "
86                       "is useful for debugging issues with either DHCP or "
87                       "DNS. If this section is null, disable dnsmasq log.")),
88     cfg.BoolOpt('dnsmasq_local_resolv', default=True,
89                 help=_("Enables the dnsmasq service to provide name "
90                        "resolution for instances via DNS resolvers on the "
91                        "host running the DHCP agent. Effectively removes the "
92                        "'--no-resolv' option from the dnsmasq process "
93                        "arguments. Adding custom DNS resolvers to the "
94                        "'dnsmasq_dns_servers' option disables this feature.")),
95     cfg.IntOpt(
96         'dnsmasq_lease_max',
97         default=(2 ** 24),
98         help=_('Limit number of leases to prevent a denial-of-service.')),
99     cfg.BoolOpt('dhcp_broadcast_reply', default=False,
100                 help=_("Use broadcast in DHCP replies")),
101 ]