Custom Execution Environment not rendering Jinja2 templates before ios_config

,

Hi all,

I’ve built a custom Execution Environment (EE) to handle creating network devices in Cisco ISE. That part works fine. However, when I run this EE with another playbook that previously worked under the stock AWX EE (24.6.1), the play fails.

Here’s the difference I’m seeing:

  • With the stock AWX EE, my playbook uses host_vars and a .j2 template. The template is rendered first, and the resulting commands are passed correctly to cisco.ios.ios_config.
  • With my custom EE, the .j2 file is not rendered. Instead, the raw Jinja syntax ({% my_stuff_here %}) is sent directly to the device as a CLI command.

My question: Is there a way to configure my custom EE so that Jinja templates are rendered before being passed to ios_config? For example, is there something I should add to the EE’s ansible.cfg or image build to ensure template rendering happens the same way it does in the stock AWX EE?

Thanks in advance for any guidance.

So, Although I did a few different things here the one that got me over the hump was adding Jinja2 to my dependencies/requirements.txt and jinja2_extensions = jinja2.ext.do,jinja2.ext.loopcontrols,jinja2.ext.i18n,jinja2.ext.with_ in my files/ansible.cfg. This finally rendered my .j2 files first and would send the correct command to the Cisco CLI

2 Likes

Hi @Sean_White, thanks for sharing the solution here.

This actually touches on an issue we were discussing recently with the network team,. I will have to check it out myself soon, probably after the holiday break :wink:

FYI: I just moved the thread to the Get Help category.

1 Like

Let me know if it works for you!