Hi,

there have been some changes when macros are used in templates. I filed
an issue for this some time ago:
https://github.com/ansible/ansible/issues/78141 Some of the changes
were not intentional and fixed in
https://github.com/ansible/ansible/commit/2aa3cc9e40f46aa9071060052a68c2e82605a9e4
(should be in the next 2.13.x release), while others are intentional
(due to changes how Jinja2 handles native types); the comments in the
issue explain some of the things that happen. Maybe this helps a bit.

Cheers,
Felix



On Fri, 5 Aug 2022 13:07:29 -0600
Richard Megginson <rmegg...@redhat.com> wrote:

> The system roles team has had two issues reported related to variables
> having different types in Jinja templates:
> 
> https://github.com/linux-system-roles/timesync/pull/154
> https://github.com/willshersystems/ansible-sshd/issues/188
> 
> Both issues appear to be related to some interaction between Jinja
> 3.0 and ansible-core 2.1x
> 
> My question is: what should we do about this in the system roles?  Do
> we really have to go through all of our Jinja template code and ensure
> variables are "cast" to their correct type?  Do we have to add
> requirements.txt, bindep, etc. to ensure that only the correct
> combinations of ansible-core and Jinja are used?
> Both of these solutions seem wrong to me, unless we have been using
> variables incorrectly in Jinja for years now, and we really should
> have been "casting" the types all along.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/20220805225937.4886bb30%40rovaniemi.

Reply via email to