Bug 1571889 - [RFE] Allow override of tftpd.map file location and/or contents during installer upgrades
Summary: [RFE] Allow override of tftpd.map file location and/or contents during instal...
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installer
Version: 6.3.1
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: 6.5.0
Assignee: Ewoud Kohl van Wijngaarden
QA Contact: Perry Gagne
Depends On:
TreeView+ depends on / blocked
Reported: 2018-04-25 15:29 UTC by Dylan Gross
Modified: 2019-11-05 22:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-05-14 12:37:13 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25190 0 Normal Closed Allow overriding the tftpd.map source location 2021-02-09 13:56:05 UTC
Red Hat Knowledge Base (Solution) 3423791 0 None None None 2018-04-25 15:42:10 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:37:20 UTC

Description Dylan Gross 2018-04-25 15:29:03 UTC
1. Proposed title of this feature request

   Allow override of tftpd.map file location and/or contents

3. What is the nature and description of the request?

   When the installer is run for upgrades, it overwrites the contents of tftpd.map.   This request would allow either a custom tftpd.map to be provided as an override or for the contents to be overridden.

4. Why does the customer need this? (List the business requirements here)

   Customer creates a custom tftpd.map file for the tftpd server.  Currently it has to be replaced after each upgrade.

5. How would the customer like to achieve this? (List the functional requirements here)

   Allow for an override of the parameter in the puppet class during the installation.

6. For each functional requirement listed in question 5, specify how Red Hat
and the customer can test to confirm the requirement is successfully implemented.

   Observe custom tftpd.map settings still in place after an upgrade

7. Is there already an existing RFE upstream or in Red Hat bugzilla?


8. Does the customer have any specific timeline dependencies?

9. Is the sales team involved in this request and do they have any additional input?


10. List any affected packages or components.


11. Would the customer be able to assist in testing this functionality if implemented?


Comment 2 Dylan Gross 2018-04-25 15:31:56 UTC

The installer code (puppet module) is here: /usr/share/foreman-installer/modules/tftp/

The main class code does not allow for server_args or map file contents to be passed as a parameter:
class tftp (
  $root             = $tftp::params::root,
  $package          = $tftp::params::package,
  $syslinux_package = $tftp::params::syslinux_package,
) inherits tftp::params {

The config class contains the resource that sets up the xinetd service.  The map file location is hard coded
      xinetd::service { 'tftp':
        port        => '69',
        server      => '/usr/sbin/in.tftpd',
        server_args => "-v -s ${::tftp::root} -m /etc/tftpd.map",
        socket_type => 'dgram',
        protocol    => 'udp',
        cps         => '100 2',
        flags       => 'IPv4',
        per_source  => '11',

The config class also contains the resource that populates the contents of the map file

      file {'/etc/tftpd.map':
        content => template('tftp/tftpd.map'),
        mode    => '0644',
        notify  => Class['xinetd'],

And the template defines the contents (also hard-coded)

# Convert backslashes to slashes
re ^bootmgr\.exe boot/bootmgr.exe
re ^\\Boot\\ boot/
rg \\ /

Comment 3 Ewoud Kohl van Wijngaarden 2018-10-09 15:55:12 UTC
Here are possible three implementations (that are not mutually exclusive options):

1) A parameter to choose the source file. These are puppet source files so can be puppet:///modules/... to refer to another module, http(s)://... to download or /path/to/file to refer to a location on disk.
2) A parameter to set the content.
3) A parameter to disable changing the contents of the file.

I'm leaning to option one but would be interested to know what the customer prefers.

Comment 5 Ewoud Kohl van Wijngaarden 2018-10-12 14:49:50 UTC
Since the customer agreed with option one, I went ahead and implemented it. It's in review at https://github.com/theforeman/puppet-tftp/pull/82 now.

Comment 6 Satellite Program 2018-10-12 16:00:45 UTC
Upstream bug assigned to ekohlvan

Comment 7 Satellite Program 2018-10-12 16:00:48 UTC
Upstream bug assigned to ekohlvan

Comment 8 Satellite Program 2018-10-15 14:00:58 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25190 has been resolved.

Comment 10 Ewoud Kohl van Wijngaarden 2019-01-15 16:21:41 UTC
This is considered an advanced feature and can only be used via custom-hiera.yaml:

  map_source: SOURCE

Here SOURCE can be any source specification that Puppet understands. The most obvious one is an absolute path to some (local) file, but it can also be any http(s) URL.

Comment 11 Perry Gagne 2019-01-15 19:49:53 UTC
NOTE : ewoulds example in c10 has a typo. The correct way to set it is:

Verified fix in Sat 6.5 snap 11. 

tftp::map_source: SOURCE 

1. Created custom tftp.map file using the example from the attached customer case. 
2. Added the following to /etc/foreman-installer/custom-hiera.yaml:

tftp::map_source: /tmp/custom-tftp.map

3. Ran satellite-installer -v 

Checked /etc/tftp.map and confirmed it was the same as custom-tftp.map

Comment 14 errata-xmlrpc 2019-05-14 12:37:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.