Problem: I want to create a job template which allows to register content hosts. I do not want to re-write all the logic from snippet ‘redhat-register’ from the Provisioning templates. I do want to allow the user to set the activation key as input which supersedes a activation key already set by the host (group), but if no user input is given I want to take it from host (group), if none is provided at all it should fail or do nothing (silently?).
Trying to reuse the snippet in a Job template fails with
Failed to initialize: RuntimeError - Failed rendering template: error during rendering: ERF42-7327 [Foreman::Exception]: The snippet 'redhat_register' threw an error: undefined method `subscription_manager_configuration_url' for #<InputTemplateRenderer:0x000000000298f0b0>
Did you mean? subscriptions_api_hosts_url
So it seems some functions are only available in provisioning templates.
Is it a bad idea overall? Should I better re-write the logic in a Job template instead of trying to use it or create an issue to make the function always available? So I am happy for any input on how to achieve my goal.
Expected outcome: Registration of content hosts is available a Remote execution template.
Foreman and Proxy versions: 1.18-RC2
Foreman and Proxy plugin versions:
bastion 6.1.10
foreman-tasks 0.13.2
foreman_docker 4.1.0
foreman_remote_execution 1.5.3
katello 3.7.0.rc1