Project

General

Profile

Bug #31751

The default kickstart template installs EPEL by default

Added by Marek Hulán 9 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Since Foreman 2.1 (thanks to #28070) if the enable-epel parameter is not set, the default kickstart template will still install the epel. This is due to

<% if rhel_compatible && !host_param_false?('enable-epel') -%>
<%= snippet 'epel' -%>
<% end -%>

https://github.com/theforeman/foreman/blob/4ff6f0a1f0b8c6227f91e6b2bcd5c33e00b22a18/app/views/unattended/provisioning_templates/provision/kickstart_default.erb#L278-L280

The problem is, host_param_false?('enable-epel') returns false in case the parameter is not found (the default value, optional second parameter). Then it's negated to true. This change was introduced in the mentioned #28070

In this ticket, we should

1) switch the default value of host_param_false? to true, like suggested in the original PR https://github.com/theforeman/foreman/pull/7110#discussion_r335387999 (the same for host_param_true?)

2) modify the template to use host_param_true?('enable-epel') and stop doing double negation

3) optionally I'd consider seeding this parameter with the default value false, so people would know, they can actually set/override it


Related issues

Related to Foreman - Bug #28070: Fallback default value for host_param_XXX? macrosClosed

Associated revisions

Revision 45c7dd75 (diff)
Added by Evgeni Golov 3 months ago

Fixes #31751 - make enable-epel false by default

Users should explicitly opt-in to have EPEL enabled on their systems

History

#1 Updated by Marek Hulán 9 months ago

  • Related to Bug #28070: Fallback default value for host_param_XXX? macros added

#2 Updated by Evgeni Golov 9 months ago

FWIW, enable-epel was added in community templates back in 2016:

commit 22f430d42a23f2c2316d990da6a56638c6fc1c84
Author: Alex Fisher <alex@linfratech.co.uk>
Date:   Sat Apr 23 16:57:40 2016 +0100

    Add enable-epel param (#266)

    Defaults to true, but provides a way to disable the use of EPEL repos.

and is supposed to default to "true", so using !host_param_false?('enable-epel') is correct from a backwards compatibility standpoint of the template (I'd disagree that we should enable epel by default, but that's a totally different discussion).

However, the default value of host_param_false? should really be true

#3 Updated by The Foreman Bot 9 months ago

  • Assignee set to Evgeni Golov
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8295 added

#4 Updated by The Foreman Bot 3 months ago

  • Fixed in Releases 3.0.0 added

#5 Updated by Evgeni Golov 3 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Tomer Brisker 3 months ago

  • Category set to Templates

Also available in: Atom PDF