Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Can we Run Command in Jinja2 Template
14 views
Skip to first unread message
Bishwajit Samanta
unread,
Jul 10, 2019, 4:35:49 PM
7/10/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi Team,
I was curious can we run command in jinja2 template say example
{{pwd}} === here pwd is a shell command.
Kai Stian Olstad
unread,
Jul 10, 2019, 4:47:34 PM
7/10/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Template only run on localhost aka Ansible controller.
So if the command you wanna run is against localhost you can use lookup plugin with pipe
https://docs.ansible.com/ansible/latest/plugins/lookup/pipe.html
--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages