debops / ansible-dhcpd

Install and configure ISC DHCP Server
GNU General Public License v3.0
22 stars 15 forks source link

Template error (file not found) when using Jinja >= 2.8 #31

Open ondrejkolin opened 6 years ago

ondrejkolin commented 6 years ago

If this is run by Jinja higher than 2.8 it fails on looking for the templates. In this bug (https://github.com/debops/debops/issues/179) there is explained, that behaviour in the Python Jinja library changed in the newer version. So templates have to be changed.

Other playbooks could be affected too.

failed: [gateway] (item=etc/dhcp/dhcpd.conf) => { "changed": false, "item": "etc/dhcp/dhcpd.conf", "msg": "AnsibleError: An unhandled exception occurred while templating '{{ lookup(\"template\", \"lookup/ifupdown__kmod__dependent_load.j2\", convert_data=False) | from_yaml }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'template'. Error was a <class 'ansible.errors.AnsibleError'>, original message: the template file lookup/ifupdown__kmod__dependent_load.j2 could not be found for the lookup" }

drybjed commented 6 years ago

That's odd... You are running the debops.dhcpd role but configuration from debops.ifupdown role makes an error. I wonder if you reference some role default variables in your Ansible inventory, that could cause issues when that role is not present, ie. a playbook of a different role is executed.

ondrejkolin commented 6 years ago

Anyway downgrading helped, I'll try to reproduce it once again and add more details.