Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure tftp root folder for RHEL8 #113

Closed
wants to merge 2 commits into from

Conversation

fchioralia
Copy link

When daemon true in RedHat family greater then 8, the tftpd service is started with the default root folder.

Require: systemd: 'https://github.com/camptocamp/puppet-systemd'

@@ -12,6 +12,26 @@
changes => "set tftpd_flags '\"-s ${tftp::root}\"'",
}
}
if $facts['os']['family'] =~ /^(RedHat)$/ {
if versioncmp($facts['os']['release']['major'], '8') == 0 {
systemd::unit_file { 'tftp.service':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be much better to use a drop in instead that just replaces ExecStart. Something like:

include systemd
systemd::dropin_file { 'root-directory':
  unit    => 'tftp.service',
  content => "[Service]\nExecStart=\nExecStart=/usr/sbin/in.tftpd -s ${tftp::root}\n",
}

# Deal with both camptocamp/systemd < 3
if defined(Class['systemd::systemctl::daemon_reload']) {
  Systemd::Dropin_file['root-directory'] ~> Class['systemd::systemctl::daemon_reload'] -> Service[$ftp::service]
}

@@ -12,6 +12,26 @@
changes => "set tftpd_flags '\"-s ${tftp::root}\"'",
}
}
if $facts['os']['family'] =~ /^(RedHat)$/ {
if versioncmp($facts['os']['release']['major'], '8') == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's actually safe to assume it's also true on newer versions (which may include Fedora):

Suggested change
if versioncmp($facts['os']['release']['major'], '8') == 0 {
if versioncmp($facts['os']['release']['major'], '8') >= 0 {

Comment on lines 14 to +15
}
if $facts['os']['family'] =~ /^(RedHat)$/ {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
if $facts['os']['family'] =~ /^(RedHat)$/ {
} elsif $facts['os']['family'] == 'RedHat' {

@ekohl ekohl linked an issue Apr 1, 2021 that may be closed by this pull request
@ekohl ekohl mentioned this pull request Apr 28, 2021
@ekohl
Copy link
Member

ekohl commented Jan 27, 2022

Included in #115

@ekohl ekohl closed this Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

configure tftp root folder for RHEL8
3 participants