Project

General

Profile

Bug #32457

Normally Inherited fields are not inherited upon host registration

Added by Marek Hulán almost 2 years ago. Updated 11 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Host registration
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

If I pick a host group during the host registration, values we normally inherit from hostgroup are not inherited, e.g. puppet environment, puppet proxy, puppet ca proxy.


Related issues

Related to Foreman - Bug #36207: Host Group Puppet Settings are not inheritedNew
Has duplicate Foreman - Bug #32304: Register host does not use puppet settings from host groupClosed

Associated revisions

Revision e60069e1 (diff)
Added by Leos Stejskal almost 2 years ago

Fixes #32457 - Register host & apply inherited attributes (#8539)

History

#1 Updated by Marek Hulán almost 2 years ago

The reason is, when host is created normally, we apply inherited attributes thanks to

https://github.com/theforeman/foreman/blob/c03c4a44a8c7891aeb470a2fde3f486199299177/app/models/host/managed.rb#L77-L80

The registration skips this and calls directly assign attributes

https://github.com/theforeman/foreman/blob/develop/app/controllers/api/v2/registration_controller.rb#L110-L119

That should be changed so the inheritance logic works like when the new host is created through the form.

#2 Updated by Damon Maria almost 2 years ago

  • Has duplicate Bug #32304: Register host does not use puppet settings from host group added

#3 Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8539 added

#4 Updated by The Foreman Bot almost 2 years ago

  • Fixed in Releases 3.0.0 added

#5 Updated by Leos Stejskal almost 2 years ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Tomer Brisker almost 2 years ago

  • Target version set to 2.5.1

#7 Updated by Tomer Brisker almost 2 years ago

  • Fixed in Releases 2.5.1 added

#8 Updated by Lioh Moeller 11 days ago

This issue is still present on Foreman 3.5.1.

Steps to reproduce:
- Create a Host Group
- Select 'Puppet Proxy', 'Puppet CA' and 'Environment' from the relevant Pull-Down-Menus on the Host Group
- Create a Global Registration Template associated with the newly created Host Group
- Register a client using the Global Registration template

The client is registered, but Puppet Parameters from the Host Group are not adopted, leading to empty ‘Environment’ ‘Puppet Proxy’ and ‘Puppet CA Proxy’ on the host object and a puppet.conf on the client which looks like this:

[main]

[agent]
pluginsync      = true
report          = true
certname        = my.host.tld

The issue does not occur if the host object already exists and Puppet settings are defined on the host object.

A partial workaround, still leading to a non-functional result, is to define puppet_ca_server and puppet_server as Parameters on the hostgroup. In this case server and ca are written correctly, but environment not. Trying to set the host_puppet_environment parameter manually on the host group, still leads to the same result (variable empty)

#9 Updated by Ewoud Kohl van Wijngaarden 11 days ago

  • Subject changed from Normally Inherited fields are not inherited upon host registreation to Normally Inherited fields are not inherited upon host registration

#10 Updated by Lioh Moeller 4 days ago

  • Related to Bug #36207: Host Group Puppet Settings are not inherited added

Also available in: Atom PDF