Merge "Add debian package for puppet-dnsmasq module"

This commit is contained in:
Zuul 2021-09-28 18:14:26 +00:00 committed by Gerrit Code Review
commit 030f277a16
15 changed files with 396 additions and 0 deletions

View File

@ -0,0 +1,5 @@
puppet-dnsmasq (1.1.0-0) unstable; urgency=medium
* Initial release
-- Dan Voiculeasa <dan.voiculeasa@windriver.com> Wed, 08 Sep 2021 11:50:43 +0000

View File

@ -0,0 +1,17 @@
Source: puppet-dnsmasq
Section: admin
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.4.1
Homepage: https://www.starlingx.io
Package: puppet-dnsmasq
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
puppet,
puppet-puppi,
puppet-module-puppetlabs-concat
Description: Puppet module named puppet-dnsmasq
A Puppet module to configure dnsmasq

View File

@ -0,0 +1,31 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: puppet-dnsmasq
Upstream-Contact: https://github.com/procore
Source: https://github.com/procore/puppet-dnsmasq
Files: *
Copyright: (C) 2013-2017 https://github.com/procore/
License: Apache-2
Upstream-Name: puppet-dnsmasq
Upstream-Contact: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Source: https://opendev.org/starlingx/integ/src/branch/master/config/puppet-modules/puppet-dnsmasq
Files: debian/*
Copyright: (c) 2021 Wind River Systems, Inc.
License: Apache-2
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.

View File

@ -0,0 +1,5 @@
LICENSE usr/share/puppet/modules.available/puppet-dnsmasq
manifests usr/share/puppet/modules.available/puppet-dnsmasq
metadata.json usr/share/puppet/modules.available/puppet-dnsmasq
spec usr/share/puppet/modules.available/puppet-dnsmasq
templates usr/share/puppet/modules.available/puppet-dnsmasq

View File

@ -0,0 +1,13 @@
#!/bin/sh
# see: dh_installdeb(1)
set -e
if [ "${1}" = "configure" ] ; then
update-alternatives --install /usr/share/puppet/modules/dnsmasq puppet-module-dnsmasq \
/usr/share/puppet/modules.available/puppet-dnsmasq 500
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,13 @@
#!/bin/sh
# see: dh_installdeb(1)
set -e
if [ "${1}" = "remove" ] || [ "${1}" = "disappear" ]; then
update-alternatives --remove puppet-module-dnsmasq \
/usr/share/puppet/modules.available/puppet-dnsmasq
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,13 @@
#!/bin/sh
# see: dh_installdeb(1)
set -e
if [ "${1}" = "remove" ] || [ "${1}" = "upgrade" || [ "${1}" = "deconfigure" ]; then
update-alternatives --remove puppet-module-dnsmasq \
/usr/share/puppet/modules.available/puppet-dnsmasq
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,7 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
%:
dh $@

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,10 @@
---
debname: puppet-dnsmasq
debver: 1.1.0-0
dl_path:
name: puppet-dnsmasq-1.1.0-0.tar.gz
url: https://codeload.github.com/procore/puppet-dnsmasq/tar.gz/a06a9127799f7376d3df985bda346f29afa19328
md5sum: c103ed8e7fa2bc386454e03dc67fc2da
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true

View File

@ -0,0 +1,116 @@
From 7430149d3a7f1ab9f93ec863e55cdf6d96cd4f06 Mon Sep 17 00:00:00 2001
From: Al Bailey <al.bailey@windriver.com>
Date: Tue, 7 Jun 2016 10:22:23 -0400
Subject: [PATCH] puppet-dnsmasq Kilo quilt patches
---
manifests/init.pp | 8 ++++++++
manifests/params.pp | 7 +++++--
templates/dnsmasq.conf.erb | 9 ++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/manifests/init.pp b/manifests/init.pp
index 176bec7..c61fd94 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -258,6 +258,13 @@
# If you don't want dnsmasq to read /etc/hosts, set this to true.
# Default: false
#
+# [*dhcp_hostsfile*]
+# Read DHCP host information from the specified file. The file contains
+# information about one host per line. The format of a line is the same
+# as text to the right of '=' in --dhcp-host. The advantage of storing
+# DHCP host information in this file is that it can be changed without
+# re-starting dnsmasq: the file will be re-read when dnsmasq receives SIGHUP.
+#
# [*addn_hosts*]
# If you want dnsmasq to read another file/s, as well as /etc/hosts, use this.
# It can be an array of files to read. See next option to manage these files with
@@ -457,6 +464,7 @@ class dnsmasq (
$no_poll = params_lookup( 'no_poll' ),
$bind_interfaces = params_lookup( 'bind_interfaces' ),
$no_hosts = params_lookup( 'no_hosts' ),
+ $dhcp_hostsfile = params_lookup( 'dhcp_hostsfile' ),
$addn_hosts = params_lookup( 'addn_hosts' ),
$addn_hosts_dir = params_lookup( 'addn_hosts_dir' ),
$expand_hosts = params_lookup( 'expand_hosts' ),
diff --git a/manifests/params.pp b/manifests/params.pp
index 5b8f02d..6dd5b96 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -38,6 +38,7 @@ class dnsmasq::params {
$process_user = $::operatingsystem ? {
/(?i:Debian|Ubuntu|Mint)/ => 'dnsmasq',
+ /(?i:wrlinux)/ => 'root',
default => 'nobody',
}
@@ -62,7 +63,7 @@ class dnsmasq::params {
}
$config_file_init = $::operatingsystem ? {
- /(?i:Debian|Ubuntu|Mint)/ => '/etc/default/dnsmasq',
+ /(?i:Debian|Ubuntu|Mint|wrlinux)/ => '/etc/default/dnsmasq',
default => '/etc/sysconfig/dnsmasq',
}
@@ -90,6 +91,7 @@ class dnsmasq::params {
$no_poll = false
$bind_interfaces = false
$no_hosts = false
+ $dhcp_hostsfile = ''
$addn_hosts = ''
$addn_hosts_dir = ''
$expand_hosts = false
@@ -115,6 +117,7 @@ class dnsmasq::params {
}
$mx_target = ''
$localmx = false
+ $selfmx = false
$server = ''
$local = ''
$address = ''
@@ -151,7 +154,7 @@ class dnsmasq::params {
$version = 'present'
$absent = false
$disable = false
- $disableboot = false
+ $disableboot = true
### General module variables that can have a site or per module default
$monitor = false
diff --git a/templates/dnsmasq.conf.erb b/templates/dnsmasq.conf.erb
index 7bc4a03..ea5aa01 100644
--- a/templates/dnsmasq.conf.erb
+++ b/templates/dnsmasq.conf.erb
@@ -3,12 +3,12 @@
<% if scope.lookupvar('dnsmasq::port') != '' -%>
port=<%= scope.lookupvar('dnsmasq::port') %>
<% end -%>
-<% if scope.lookupvar('dnsmasq::bool_domain_need') -%>
-domain-needed
-<% end -%>
<% if scope.lookupvar('dnsmasq::bool_bogus_priv') -%>
bogus-priv
<% end -%>
+<% if scope.lookupvar('dnsmasq::bool_domain_needed') -%>
+domain-needed
+<% end -%>
<% if scope.lookupvar('dnsmasq::bool_filterwin2k') -%>
filterwin2k
<% end -%>
@@ -33,6 +33,9 @@ bind-interfaces
<% if scope.lookupvar('dnsmasq::bool_no_hosts') -%>
no-hosts
<% end -%>
+<% if scope.lookupvar('dnsmasq::dhcp_hostsfile') != '' -%>
+dhcp-hostsfile=<%= scope.lookupvar('dnsmasq::dhcp_hostsfile') %>
+<% end -%>
<% if scope.lookupvar('dnsmasq::bool_expand_hosts') -%>
expand-hosts
<% end -%>
--
1.8.3.1

View File

@ -0,0 +1,27 @@
From b8308a495f853d066c5c0e5d2257a070b033f626 Mon Sep 17 00:00:00 2001
From: Kam Nasim <kam.nasim@windriver.com>
Date: Tue, 5 Jul 2016 16:46:28 -0400
Subject: [PATCH] CGTS-4280: Fixing mismatched permission on dnsmasq.conf which
was set to 0640 when created from config_controller (controller-0) but was at
0644 on controller-1 through application of this manifest.
---
manifests/params.pp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifests/params.pp b/manifests/params.pp
index 6dd5b96..6129b57 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -51,7 +51,7 @@ class dnsmasq::params {
}
$config_file_mode = $::operatingsystem ? {
- default => '0644',
+ default => '0640',
}
$config_file_owner = $::operatingsystem ? {
--
1.8.3.1

View File

@ -0,0 +1,62 @@
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
---
manifests/init.pp | 4 ++++
manifests/params.pp | 1 +
templates/dnsmasq.conf.erb | 3 +++
3 files changed, 8 insertions(+)
diff --git a/manifests/init.pp b/manifests/init.pp
index c61fd94..b66ac17 100644
--- a/manifests/init.pp
+++ b/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/manifests/params.pp b/manifests/params.pp
index 6129b57..845e91e 100644
--- a/manifests/params.pp
+++ b/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/templates/dnsmasq.conf.erb b/templates/dnsmasq.conf.erb
index ea5aa01..6a6cbdf 100644
--- a/templates/dnsmasq.conf.erb
+++ b/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

View File

@ -0,0 +1,72 @@
From 35fa3c673307db2ebed20c952817608fadd26fa6 Mon Sep 17 00:00:00 2001
From: Tao Liu <tao.liu@windriver.com>
Date: Thu, 22 Jun 2017 16:33:29 -0400
Subject: [PATCH 1/1] Enable clear the DNS cache on reload
---
manifests/init.pp | 7 +++++++
manifests/params.pp | 1 +
templates/dnsmasq.conf.erb | 3 +++
3 files changed, 11 insertions(+)
diff --git a/manifests/init.pp b/manifests/init.pp
index b66ac17..93276bb 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -211,6 +211,11 @@
# bringing up the link unnecessarily.
# Default: true
#
+# [*clear_on_reload*]
+# Whenever /etc/resolv.conf is re-read or the upstream servers are set via
+# DBus, clear the DNS cache.
+# Default: true
+#
# [*filterwin2k*]
# Uncomment this to filter useless windows-originated DNS requests
# which can trigger dial-on-demand links needlessly.
@@ -460,6 +465,7 @@ class dnsmasq (
$protocol = params_lookup( 'protocol' ),
$domain_needed = params_lookup( 'domain_needed' ),
$bogus_priv = params_lookup( 'bogus_priv' ),
+ $clear_on_reload = params_lookup( 'clear_on_reload' ),
$filterwin2k = params_lookup( 'filterwin2k' ),
$resolv_file = params_lookup( 'resolv_file' ),
$strict_order = params_lookup( 'strict_order' ),
@@ -531,6 +537,7 @@ class dnsmasq (
$bool_domain_needed=any2bool($domain_needed)
$bool_bogus_priv=any2bool($bogus_priv)
+ $bool_clear_on_reload=any2bool($clear_on_reload)
$bool_filterwin2k=any2bool($filterwin2k)
$bool_strict_order=any2bool($strict_order)
$bool_no_resolv=any2bool($no_resolv)
diff --git a/manifests/params.pp b/manifests/params.pp
index 845e91e..4d8e70a 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -84,6 +84,7 @@ class dnsmasq::params {
$domain_needed = true
$bogus_priv = true
+ $clear_on_reload = true
$filterwin2k = false
$resolv_file = ''
$strict_order = false
diff --git a/templates/dnsmasq.conf.erb b/templates/dnsmasq.conf.erb
index bb8d941..109b768 100644
--- a/templates/dnsmasq.conf.erb
+++ b/templates/dnsmasq.conf.erb
@@ -9,6 +9,9 @@ bogus-priv
<% if scope.lookupvar('dnsmasq::bool_domain_needed') -%>
domain-needed
<% end -%>
+<% if scope.lookupvar('dnsmasq::bool_clear_on_reload') -%>
+clear-on-reload
+<% end -%>
<% if scope.lookupvar('dnsmasq::bool_filterwin2k') -%>
filterwin2k
<% end -%>
--
1.8.3.1

View File

@ -0,0 +1,4 @@
0001-puppet-dnsmasq-Kilo-quilt-patches.patch
0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch
0003-Support-management-of-tftp_max-option.patch
0004-Enable-clear-DNS-cache-on-reload.patch