From 430c3b97e3324b84d1587d220cc977eeacc9d976 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Tue, 8 Jun 2021 10:32:10 +0800 Subject: [PATCH] puppet-dnsmasq: update for stx 5.0 * inherit stx-metadata to help apply patches from stx 'integ' repo * remove the local copy of stx patches Issue-ID: INF-215 Signed-off-by: Jackie Huang Change-Id: Iffc759a8f92147cd45542789bf25bb7ad17db915 --- .../0001-puppet-dnsmasq-Kilo-quilt-patches.patch | 116 --------------------- ...ing-mismatched-permission-on-dnsmasq-conf.patch | 27 ----- ...003-Support-management-of-tftp_max-option.patch | 62 ----------- .../0004-Enable-clear-DNS-cache-on-reload.patch | 72 ------------- .../puppet/puppet-dnsmasq_git.bbappend | 16 ++- 5 files changed, 11 insertions(+), 282 deletions(-) delete mode 100644 meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0001-puppet-dnsmasq-Kilo-quilt-patches.patch delete mode 100644 meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch delete mode 100644 meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0003-Support-management-of-tftp_max-option.patch delete mode 100644 meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0004-Enable-clear-DNS-cache-on-reload.patch diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0001-puppet-dnsmasq-Kilo-quilt-patches.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0001-puppet-dnsmasq-Kilo-quilt-patches.patch deleted file mode 100644 index ff631ec..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0001-puppet-dnsmasq-Kilo-quilt-patches.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 7430149d3a7f1ab9f93ec863e55cdf6d96cd4f06 Mon Sep 17 00:00:00 2001 -From: Al Bailey -Date: Tue, 7 Jun 2016 10:22:23 -0400 -Subject: [PATCH] puppet-dnsmasq Kilo quilt patches - ---- - packstack/puppet/modules/dnsmasq/manifests/init.pp | 8 ++++++++ - packstack/puppet/modules/dnsmasq/manifests/params.pp | 7 +++++-- - packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb | 9 ++++++--- - 3 files changed, 19 insertions(+), 5 deletions(-) - -diff --git a/packstack/puppet/modules/dnsmasq/manifests/init.pp b/packstack/puppet/modules/dnsmasq/manifests/init.pp -index 176bec7..c61fd94 100644 ---- a/packstack/puppet/modules/dnsmasq/manifests/init.pp -+++ b/packstack/puppet/modules/dnsmasq/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/packstack/puppet/modules/dnsmasq/manifests/params.pp b/packstack/puppet/modules/dnsmasq/manifests/params.pp -index 5b8f02d..6dd5b96 100644 ---- a/packstack/puppet/modules/dnsmasq/manifests/params.pp -+++ b/packstack/puppet/modules/dnsmasq/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/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb b/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb -index 7bc4a03..ea5aa01 100644 ---- a/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb -+++ b/packstack/puppet/modules/dnsmasq/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 - diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch deleted file mode 100644 index 40d422e..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b8308a495f853d066c5c0e5d2257a070b033f626 Mon Sep 17 00:00:00 2001 -From: Kam Nasim -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. - ---- - packstack/puppet/modules/dnsmasq/manifests/params.pp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/packstack/puppet/modules/dnsmasq/manifests/params.pp b/packstack/puppet/modules/dnsmasq/manifests/params.pp -index 6dd5b96..6129b57 100644 ---- a/packstack/puppet/modules/dnsmasq/manifests/params.pp -+++ b/packstack/puppet/modules/dnsmasq/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 - diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0003-Support-management-of-tftp_max-option.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0003-Support-management-of-tftp_max-option.patch deleted file mode 100644 index 08341e8..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0003-Support-management-of-tftp_max-option.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 017e2ed0c664fb8689f6a9c4352db740c2c39725 Mon Sep 17 00:00:00 2001 -From: Don Penney -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 - diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0004-Enable-clear-DNS-cache-on-reload.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0004-Enable-clear-DNS-cache-on-reload.patch deleted file mode 100644 index 65b6771..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/puppet-dnsmasq/0004-Enable-clear-DNS-cache-on-reload.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 35fa3c673307db2ebed20c952817608fadd26fa6 Mon Sep 17 00:00:00 2001 -From: Tao Liu -Date: Thu, 22 Jun 2017 16:33:29 -0400 -Subject: [PATCH 1/1] Enable clear the DNS cache on reload - ---- - packstack/puppet/modules/dnsmasq/manifests/init.pp | 7 +++++++ - packstack/puppet/modules/dnsmasq/manifests/params.pp | 1 + - packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb | 3 +++ - 3 files changed, 11 insertions(+) - -diff --git a/packstack/puppet/modules/dnsmasq/manifests/init.pp b/packstack/puppet/modules/dnsmasq/manifests/init.pp -index b66ac17..93276bb 100644 ---- a/packstack/puppet/modules/dnsmasq/manifests/init.pp -+++ b/packstack/puppet/modules/dnsmasq/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/packstack/puppet/modules/dnsmasq/manifests/params.pp b/packstack/puppet/modules/dnsmasq/manifests/params.pp -index 845e91e..4d8e70a 100644 ---- a/packstack/puppet/modules/dnsmasq/manifests/params.pp -+++ b/packstack/puppet/modules/dnsmasq/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/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb b/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb -index bb8d941..109b768 100644 ---- a/packstack/puppet/modules/dnsmasq/templates/dnsmasq.conf.erb -+++ b/packstack/puppet/modules/dnsmasq/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 - diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-dnsmasq_git.bbappend b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-dnsmasq_git.bbappend index 43bfb09..07ad6f7 100644 --- a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-dnsmasq_git.bbappend +++ b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/puppet-dnsmasq_git.bbappend @@ -1,10 +1,16 @@ +inherit stx-metadata + +STX_REPO = "integ" +STX_SUBPATH = "config/puppet-modules/${BPN}/centos/files" + +SRC_URI_STX += " \ + file://0001-puppet-dnsmasq-Kilo-quilt-patches.patch;striplevel=5 \ + file://0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch;striplevel=5 \ + file://0003-Support-management-of-tftp_max-option.patch;striplevel=5 \ + file://0004-Enable-clear-DNS-cache-on-reload.patch;striplevel=5 \ + " -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += " \ - file://${BPN}/0001-puppet-dnsmasq-Kilo-quilt-patches.patch;striplevel=5 \ - file://${BPN}/0002-Fixing-mismatched-permission-on-dnsmasq-conf.patch;striplevel=5 \ - file://${BPN}/0003-Support-management-of-tftp_max-option.patch;striplevel=5 \ - file://${BPN}/0004-Enable-clear-DNS-cache-on-reload.patch;striplevel=5 \ file://${BPN}/0005-puppet-dnsmasq-updates-for-poky-stx.patch;striplevel=5 \ " -- 2.16.6