Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
default["neutron"]["isolated_metadata"] = "True"
default["neutron"]["metadata_network"] = "False"
default["neutron"]["dnsmasq_lease_max"] = 16777216
default["neutron"]["dnsmasq_config_file"] = "/etc/neutron/dsnmasq-neutron.conf"
default["neutron"]["dnsmasq_dns_server"] = nil # this is a single string, not an array
default["neutron"]["dnsmasq_dhcp_script"] = nil
default["neutron"]["service_neutron_metadata_proxy"] = "True"
default["neutron"]["agent_down_time"] = 30

Expand Down
12 changes: 12 additions & 0 deletions recipes/neutron-dhcp-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,21 @@
variables(
"use_debug" => node["neutron"]["debug"],
"dnsmasq_lease" => node["neutron"]["dnsmasq_lease_max"],
"dnsmasq_config_file" => node["neutron"]["dnsmasq_config_file"],
"dnsmasq_dns_server" => node["neutron"]["dnsmasq_dns_server"],
"neutron_metadata_network" => node["neutron"]["metadata_network"],
"neutron_isolated" => node["neutron"]["isolated_metadata"],
"neutron_plugin" => node["neutron"]["plugin"],
"neutron_dhcp_domain" => node["neutron"]["dhcp_domain"]
)
end

template node["neutron"]["dnsmasq_config_file"] do
source "dnsmasq-neutron.conf.erb"
owner "root"
group "neutron"
mode "0640"
variables(
"dhcp_script" => node["neutron"]["dnsmasq_dhcp_script"]
)
end
4 changes: 4 additions & 0 deletions templates/default/dhcp_agent.ini.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ enable_metadata_network = <%= @neutron_metadata_network %>
##### DNS MASQ #####
# Limit number of leases to prevent a denial-of-service.
dnsmasq_lease_max = <%= @dnsmasq_lease %>
dnsmasq_config_file = <%= @dnsmasq_config_file %>
<% unless @dnsmasq_dns_server.nil? %>
dnsmasq_dns_server = <%= @dnsmasq_dns_server %>
<% end %>


<% if @neutron_plugin == "ovs" %>
Expand Down
10 changes: 10 additions & 0 deletions templates/default/dnsmasq-neutron.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file autogenerated by Chef
# Do not edit, changes will be overwritten

# make default MTU smaller to allow for overhead of OVS tags
# https://github.com/rcbops/chef-cookbooks/issues/709
dhcp-option=26,1454

<% unless @dhcp_script.nil? %>
dhcp-script=@dhcp_script
<% end %>