Try escaping the % character.

Thanks
Bijay

On Wednesday, 24 June 2020 12:41:56 UTC+5:30, Rahul Kumar wrote:
>
> Hi Ansible Gurus ,
> i have below task :
> - name: RPM EPOCH Finder
>     #command: rpm -qa --qf '%|EPOCH?{%{EPOCH}}:{0}|\n' {{ 
> item.split('.')[0] | regex_replace('-\d+', '')}}
>     command: rpm -qa --qf '%|EPOCH?{%{EPOCH}}:{0}|\n' {{ 
> item.split('.')[0] | regex_replace('-\d+', '')}}
>     with_items:
>       - "{{ my_hotfix_rpms }}"
>     register: r
>     args:
>       warn: false 
>  I am trying to get a part of RPM name (Epoch) from rpm list in a system. If 
> Epoch is present then it prints the value otherwise prints “0”. Since this 
> package name can have any version , so I am using regex to fetch only the 
> name from the variable.
> But I am getting an error telling it is an incomplete Jinja template .Is 
> it because of the ternary operator used?  Any idea ?
>
> Regards
> Rahul   
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c67a41c6-9cc5-497b-a4a0-366399de3b96o%40googlegroups.com.

Reply via email to