diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2014-03-25 14:12:04 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-04-15 19:48:37 -0400 |
| commit | 509875734bb5e935436d2b09192e8b5e4c1500cb (patch) | |
| tree | 593466aadfb732c9f2f097bce363b474d29ff5ac /meta-openstack/recipes-devtools | |
| parent | 1768e94b9e600884d43e65b3ef05e379f043a196 (diff) | |
| download | meta-cloud-services-509875734bb5e935436d2b09192e8b5e4c1500cb.tar.gz | |
python-neutron: cleanup dhcp agent packaging
Cleanup packaging to get the necessary .ini and related files
into the dhcp-agent package. Add a cron job to keep things
clean.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools')
3 files changed, 92 insertions, 2 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-neutron/dhcp_agent.ini b/meta-openstack/recipes-devtools/python/python-neutron/dhcp_agent.ini new file mode 100644 index 0000000..f9b1523 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-neutron/dhcp_agent.ini | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | [DEFAULT] | ||
| 2 | # Show debugging output in log (sets DEBUG log level output) | ||
| 3 | # debug = False | ||
| 4 | |||
| 5 | # The DHCP agent will resync its state with Neutron to recover from any | ||
| 6 | # transient notification or rpc errors. The interval is number of | ||
| 7 | # seconds between attempts. | ||
| 8 | # resync_interval = 5 | ||
| 9 | |||
| 10 | # The DHCP agent requires an interface driver be set. Choose the one that best | ||
| 11 | # matches your plugin. | ||
| 12 | # interface_driver = | ||
| 13 | |||
| 14 | # Example of interface_driver option for OVS based plugins(OVS, Ryu, NEC, NVP, | ||
| 15 | # BigSwitch/Floodlight) | ||
| 16 | interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver | ||
| 17 | |||
| 18 | # Use veth for an OVS interface or not. | ||
| 19 | # Support kernels with limited namespace support | ||
| 20 | # (e.g. RHEL 6.5) so long as ovs_use_veth is set to True. | ||
| 21 | # ovs_use_veth = False | ||
| 22 | |||
| 23 | # Example of interface_driver option for LinuxBridge | ||
| 24 | # interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver | ||
| 25 | |||
| 26 | # The agent can use other DHCP drivers. Dnsmasq is the simplest and requires | ||
| 27 | # no additional setup of the DHCP server. | ||
| 28 | # dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq | ||
| 29 | |||
| 30 | # Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and | ||
| 31 | # iproute2 package that supports namespaces). | ||
| 32 | # use_namespaces = True | ||
| 33 | |||
| 34 | # The DHCP server can assist with providing metadata support on isolated | ||
| 35 | # networks. Setting this value to True will cause the DHCP server to append | ||
| 36 | # specific host routes to the DHCP request. The metadata service will only | ||
| 37 | # be activated when the subnet does not contain any router port. The guest | ||
| 38 | # instance must be configured to request host routes via DHCP (Option 121). | ||
| 39 | # enable_isolated_metadata = False | ||
| 40 | |||
| 41 | # Allows for serving metadata requests coming from a dedicated metadata | ||
| 42 | # access network whose cidr is 169.254.169.254/16 (or larger prefix), and | ||
| 43 | # is connected to a Neutron router from which the VMs send metadata | ||
| 44 | # request. In this case DHCP Option 121 will not be injected in VMs, as | ||
| 45 | # they will be able to reach 169.254.169.254 through a router. | ||
| 46 | # This option requires enable_isolated_metadata = True | ||
| 47 | # enable_metadata_network = False | ||
| 48 | |||
| 49 | # Number of threads to use during sync process. Should not exceed connection | ||
| 50 | # pool size configured on server. | ||
| 51 | # num_sync_threads = 4 | ||
| 52 | |||
| 53 | # Location to store DHCP server config files | ||
| 54 | # dhcp_confs = $state_path/dhcp | ||
| 55 | |||
| 56 | # Domain to use for building the hostnames | ||
| 57 | # dhcp_domain = openstacklocal | ||
| 58 | |||
| 59 | # Override the default dnsmasq settings with this file | ||
| 60 | # dnsmasq_config_file = | ||
| 61 | |||
| 62 | # Use another DNS server before any in /etc/resolv.conf. | ||
| 63 | # dnsmasq_dns_server = | ||
| 64 | |||
| 65 | # Limit number of leases to prevent a denial-of-service. | ||
| 66 | # dnsmasq_lease_max = 16777216 | ||
| 67 | |||
| 68 | # Location to DHCP lease relay UNIX domain socket | ||
| 69 | # dhcp_lease_relay_socket = $state_path/dhcp/lease_relay | ||
| 70 | |||
| 71 | # Location of Metadata Proxy UNIX domain socket | ||
| 72 | # metadata_proxy_socket = $state_path/metadata_proxy | ||
diff --git a/meta-openstack/recipes-devtools/python/python-neutron/neutron-dhcp-agent-netns-cleanup.cron b/meta-openstack/recipes-devtools/python/python-neutron/neutron-dhcp-agent-netns-cleanup.cron new file mode 100644 index 0000000..0ebd6c5 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-neutron/neutron-dhcp-agent-netns-cleanup.cron | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | # Periodically cleans Neutron's network namespaces on behalf of the Neutron DHCP agent. | ||
| 2 | 30 * * * * neutron if [ -x @bindir@/neutron-netns-cleanup ] ; then @bindir@/neutron-netns-cleanup --config-file=@confdir@/neutron/neutron.conf --config-file=@confdir@/neutron/dhcp_agent.ini >/dev/null 2>&1; fi | ||
diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index b256c79..1621923 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb | |||
| @@ -13,6 +13,8 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | |||
| 13 | file://neutron-server.init \ | 13 | file://neutron-server.init \ |
| 14 | file://neutron-agent.init \ | 14 | file://neutron-agent.init \ |
| 15 | file://l3_agent.ini \ | 15 | file://l3_agent.ini \ |
| 16 | file://dhcp_agent.ini \ | ||
| 17 | file://neutron-dhcp-agent-netns-cleanup.cron \ | ||
| 16 | " | 18 | " |
| 17 | SRCREV="8cb9d895675f2a89c6b741da4b594f416fbeee5a" | 19 | SRCREV="8cb9d895675f2a89c6b741da4b594f416fbeee5a" |
| 18 | PV="2013.2.2+git${SRCPV}" | 20 | PV="2013.2.2+git${SRCPV}" |
| @@ -64,6 +66,17 @@ do_install_append() { | |||
| 64 | install -m 0755 ${WORKDIR}/neutron-$PLUGIN.init.sh ${D}${sysconfdir}/init.d/neutron-$PLUGIN-agent | 66 | install -m 0755 ${WORKDIR}/neutron-$PLUGIN.init.sh ${D}${sysconfdir}/init.d/neutron-$PLUGIN-agent |
| 65 | fi | 67 | fi |
| 66 | 68 | ||
| 69 | AGENT=dhcp | ||
| 70 | ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/dhcp_agent.ini" | ||
| 71 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 72 | sed "s:@suffix@:$AGENT:;s:@args@:$ARGS:" < ${WORKDIR}/neutron-agent.init >${WORKDIR}/neutron-$AGENT.init.sh | ||
| 73 | install -m 0755 ${WORKDIR}/neutron-$AGENT.init.sh ${D}${sysconfdir}/init.d/neutron-$AGENT-agent | ||
| 74 | install -m 600 ${WORKDIR}/${AGENT}_agent.ini ${NEUTRON_CONF_DIR}/ | ||
| 75 | sed "s:@bindir@:${bindir}:g;s:@confdir@:${sysconfdir}:g" < ${WORKDIR}/neutron-dhcp-agent-netns-cleanup.cron >${WORKDIR}/neutron-dhcp-agent-netns-cleanup | ||
| 76 | install -d ${D}${sysconfdir}/cron.d | ||
| 77 | install -m 644 ${WORKDIR}/neutron-dhcp-agent-netns-cleanup ${D}${sysconfdir}/cron.d/ | ||
| 78 | fi | ||
| 79 | |||
| 67 | AGENT=l3 | 80 | AGENT=l3 |
| 68 | ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/l3_agent.ini" | 81 | ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/l3_agent.ini" |
| 69 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 82 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| @@ -152,7 +165,8 @@ FILES_${SRCNAME}-plugin-linuxbridge = " \ | |||
| 152 | FILES_${SRCNAME}-dhcp-agent = "${bindir}/neutron-dhcp-agent \ | 165 | FILES_${SRCNAME}-dhcp-agent = "${bindir}/neutron-dhcp-agent \ |
| 153 | ${bindir}/neutron-dhcp-agent-dnsmasq-lease-update \ | 166 | ${bindir}/neutron-dhcp-agent-dnsmasq-lease-update \ |
| 154 | ${sysconfdir}/${SRCNAME}/dhcp_agent.ini \ | 167 | ${sysconfdir}/${SRCNAME}/dhcp_agent.ini \ |
| 155 | ${sysconfdir}/init.d/dhcp_agent \ | 168 | ${sysconfdir}/init.d/neutron-dhcp-agent \ |
| 169 | ${sysconfdir}/cron.d/neutron-dhcp-agent-netns-cleanup \ | ||
| 156 | " | 170 | " |
| 157 | 171 | ||
| 158 | FILES_${SRCNAME}-l3-agent = "${bindir}/neutron-l3-agent \ | 172 | FILES_${SRCNAME}-l3-agent = "${bindir}/neutron-l3-agent \ |
| @@ -212,12 +226,14 @@ RDEPENDS_${SRCNAME}-setup = "postgresql sudo" | |||
| 212 | 226 | ||
| 213 | RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" | 227 | RRECOMMENDS_${SRCNAME}-server = "${SRCNAME}-plugin-openvswitch" |
| 214 | 228 | ||
| 215 | INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge ${SRCNAME}-l3-agent" | 229 | INITSCRIPT_PACKAGES = "${SRCNAME}-server ${SRCNAME}-plugin-openvswitch ${SRCNAME}-plugin-linuxbridge ${SRCNAME}-dhcp-agent ${SRCNAME}-l3-agent" |
| 216 | INITSCRIPT_NAME_${SRCNAME}-server = "neutron-server" | 230 | INITSCRIPT_NAME_${SRCNAME}-server = "neutron-server" |
| 217 | INITSCRIPT_PARAMS_${SRCNAME}-server = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 231 | INITSCRIPT_PARAMS_${SRCNAME}-server = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
| 218 | INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "neutron-openvswitch-agent" | 232 | INITSCRIPT_NAME_${SRCNAME}-plugin-openvswitch = "neutron-openvswitch-agent" |
| 219 | INITSCRIPT_PARAMS_${SRCNAME}-plugin-openvswitch = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 233 | INITSCRIPT_PARAMS_${SRCNAME}-plugin-openvswitch = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
| 220 | INITSCRIPT_NAME_${SRCNAME}-plugin-linuxbridge = "neutron-linuxbridge-agent" | 234 | INITSCRIPT_NAME_${SRCNAME}-plugin-linuxbridge = "neutron-linuxbridge-agent" |
| 221 | INITSCRIPT_PARAMS_${SRCNAME}-plugin-linuxbridge = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 235 | INITSCRIPT_PARAMS_${SRCNAME}-plugin-linuxbridge = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
| 236 | INITSCRIPT_NAME_${SRCNAME}-dhcp-agent = "neutron-dhcp-agent" | ||
| 237 | INITSCRIPT_PARAMS_${SRCNAME}-dhcp-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||
| 222 | INITSCRIPT_NAME_${SRCNAME}-l3-agent = "neutron-l3-agent" | 238 | INITSCRIPT_NAME_${SRCNAME}-l3-agent = "neutron-l3-agent" |
| 223 | INITSCRIPT_PARAMS_${SRCNAME}-l3-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | 239 | INITSCRIPT_PARAMS_${SRCNAME}-l3-agent = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
