I’m trying to run Ansible roles against a host and getting this error message:
Failed to initialize: RuntimeError - Cannot find rabl template ‘api/v2/hosts/expiration’ within registered (["/usr/share/foreman/app/views"]) view paths!
This is after performing a clean install with foreman-installer.
It appears to be related to another plugin I have, foreman_expire_hosts.
The Ansible roles are applied to the host
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)
@paulcalabro: Thanks. Can you please provide the full stack trace of the error message to narrow down the issue? It should be in
Can you access
https://foreman.example.com/api/v2/hosts?per_page=10 without any issue?
I have an idea where this might come from. As a workaround, you can
comment this line.
This is something we have to fix either in core (that provided the extension point) or the ansible plugin (that renders a rabl template).
Thanks for the assist. I’ll spin up another box, try this out, and get back to you.
i commented the line under
opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-5.1.0/lib/foreman_expire_hosts/engine.rb out and it still doesnt work
February 14, 2019, 8:30pm
I too facing same issues. We are running
ailed to initialize: RuntimeError - Cannot find rabl template ‘api/v2/hosts/expiration’ within registered (["/usr/share/foreman/app/views", “/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-14.0.1/app/views”]) view paths!,
Look like your expire_hosts plugin may be installed incorrectly, since it doesn’t show up in the path. How did you install it?
February 19, 2019, 4:56pm
All plugins got installed along with Foreman (foremaninstaller -i: selected required plugins, including expire)
Yesterday i removed expire plugin and restarted foreman: It was showing error on the front end. SO reinstalled same plugins using following commands
#yum remove tfm-rubygem-foreman_expire_hosts
#yum install tfm-rubygem-foreman_expire_hosts.noarch
But problem not fixed, please help.
I’m having the same issue. Foreman 1.21 katello 3.11 ansible + expire_hosts.
expire_hosts installed with yum, as I do not have that option from foreman-installer.
Did you guys figure out some work-around?
I found some work-around that works for me.
You need to get file expiration.json.rabl from:
and put into /usr/share/foreman/app/views/api/v2/hosts/
June 27, 2019, 3:59pm
You don´t need to download it, search for expiration.json.rabl and once you´ve got it create a soft link to
I´ve done and it works but the timesync role now is complain because “Multiple NTP providers are currently active/enabled”.
Do you know how to forward variables (like -e in command line ) from foreman when you want to run the role?