-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fixes #36207 - assign puppet attributes from hostgroup #401
Conversation
save | ||
end | ||
|
||
def inherited_attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is missing for sure so that attributes from hostgroup are used. Same as in katello, openscap, salt...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know @ekohl (or know someone who maybe can answer this question), why this method did not exist in puppet but is used for Katello, OpenSCAP, Salt.
How does this work, if you create a host which is using a hostgroup, that this host is using the "templated values" from hostgroup without this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is related to facets (environment_id is provided by the puppet facet), maybe we can also ping @ShimShtein
@@ -55,6 +55,15 @@ def search_by_config_group(_key, operator, value) | |||
end | |||
|
|||
module PrependedMethods | |||
def environment_id=(id) | |||
self.environment = ForemanPuppet::Environment.find(id) | |||
save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this good or does it break something to have a environment_id
method?
can the save
be improved?
@@ -30,6 +30,26 @@ class << self | |||
ext_method: :search_by_config_group | |||
end | |||
|
|||
def inherited_puppet_hostgroup_attribute(attribute) | |||
if ancestry.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grabbed and adapted from foreman_openscap
No description provided.