integ/devtools/puppet-modules/puppet-dnsmasq/centos/files/0003-Support-management-of-...

63 lines
2.5 KiB
Diff

From 017e2ed0c664fb8689f6a9c4352db740c2c39725 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
Date: Thu, 15 Sep 2016 16:49:48 -0400
Subject: [PATCH] Support management of tftp_max option
---
packstack/puppet/modules/dnsmasq/manifests/init.pp | 4 ++++
packstack/puppet/modules/dnsmasq/manifests/params.pp | 1 +
packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb | 3 +++
3 files changed, 8 insertions(+)
diff --git a/packstack/puppet/modules/dnsmasq/manifests/init.pp b/packstack/puppet/modules/dnsmasq/manifests/init.pp
index c61fd94..b66ac17 100644
--- a/packstack/puppet/modules/dnsmasq/manifests/init.pp
+++ b/packstack/puppet/modules/dnsmasq/manifests/init.pp
@@ -328,6 +328,9 @@
# Enable dnsmasq's built-in TFTP server
# Default: false
#
+# [*tftp_max*]
+# Max tftp connections
+#
# [*tftp_secure*]
# Make the TFTP server more secure: with this set, only files owned by
# the user dnsmasq is running as will be send over the net.
@@ -476,6 +479,7 @@ class dnsmasq (
$pxe_prompt_timeout = params_lookup( 'pxe_prompt_timeout' ),
$pxe_service = params_lookup( 'pxe_service' ),
$enable_tftp = params_lookup( 'enable_tftp' ),
+ $tftp_max = params_lookup( 'tftp_max' ),
$tftp_secure = params_lookup( 'tftp_secure' ),
$tftp_root = params_lookup( 'tftp_root' ),
$dhcp_lease_max = params_lookup( 'dhcp_lease_max' ),
diff --git a/packstack/puppet/modules/dnsmasq/manifests/params.pp b/packstack/puppet/modules/dnsmasq/manifests/params.pp
index 6129b57..845e91e 100644
--- a/packstack/puppet/modules/dnsmasq/manifests/params.pp
+++ b/packstack/puppet/modules/dnsmasq/manifests/params.pp
@@ -103,6 +103,7 @@ class dnsmasq::params {
$pxe_prompt_timeout = '60'
$pxe_service = ''
$enable_tftp = false
+ $tftp_max = ''
$tftp_secure = false
$tftp_root = ''
$dhcp_lease_max = ''
diff --git a/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb b/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb
index ea5aa01..6a6cbdf 100644
--- a/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb
+++ b/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb
@@ -60,6 +60,9 @@ pxe-service=<%= scope.lookupvar('dnsmasq::pxe_service') %>
<% if scope.lookupvar('dnsmasq::bool_enable_tftp') -%>
enable-tftp
<% end -%>
+<% if scope.lookupvar('dnsmasq::tftp_max') != '' -%>
+tftp-max=<%= scope.lookupvar('dnsmasq::tftp_max') %>
+<% end -%>
<% if scope.lookupvar('dnsmasq::bool_tftp_secure') -%>
tftp-secure
<% end -%>
--
1.8.3.1