fixes #6861 - properly detect host group provisioning in the templates

Needs https://github.com/theforeman/foreman/pull/1637, but should be backwards compatible w/ older versions too.
`.nil?`