Skip to content

Add support for overriding provisioning template method for host group #13

Open
@lucasm-iRonin

Description

Currently when template for hostgroup is rendered it queries the database directly - https://github.com/theforeman/foreman/blob/f715a7c98457c6f43a1f803a75ba4540372d8544/app/controllers/unattended_controller.rb#L43-L45 so we don't have the option to render the template from file without corresponding template in the database. One of the options to fix it would be to change:

template = ProvisioningTemplate.find_by_name(params['id'].to_s)
@host = Hostgroup.find_by_title(params['hostgroup'].to_s)

to:

@host = Hostgroup.find_by_title(params['hostgroup'].to_s)
template = @host.provisioning_template(params['id'].to_s)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions