Rendering template issue undefined method '#bond?'

I get below error when rendering with foreman 1.24.2 and community templates

Errr message is:

There was an error rendering the Kickstart default PXELinux template: ERF42-7327 [Foreman::Exception]: The snippet 'kickstart_kernel_options' threw an error: undefined method '#bond?' for Nic::Base::Jail (Nic::Managed)

In the kickstart_kernel_options:

  # bond
  if && rhel_compatible && os_major >= 6
    options.push("bond=#{iface.identifier}:#{iface.attached_devices_identifiers}:mode=#{iface.mode},#{' ', ',')}")

Any idea what could be the reason?


Foreman ships with the community templates preinstalled matching the foreman version.
The templates in community templates repository develop branch should be used only with nightly foreman builds, as they rely on functionality that may not have been implemented in older versions (as in this case).


thanks for the awnser.
I imported the templates from repo because i need some other templates that were only
available there(WIMan Windows provisioning templates)

So when i need some special templates from the repo it is not recommended to import community templates from git with import-templates but only download and import the needed templates correct?


Templates in the develop branch of the repo may not be compatible with your current foreman version. If you want to import newer templates than the ones shipped by Foreman, you will need to debug any such issues on your own.
Foreman ships with the tested and supported version of the templates for each version, and there is no guarantee that any template manually imported from this repo or elsewhere will function as expected with a different Foreman version than what it was intended for.

1 Like

Just to add a small bit of information: The community-templates repository has also branches matching the Foreman release cycle, so better than using develop which has code for the next version use e.g. 2.0-stable for 2.0. I used this very successfully when needed, but as Tomer said those not available by default are only community tested and sometimes are not updated if the original author does not maintain it.