Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Filtering on a Template variable
12 views
Skip to first unread message
Anfield
unread,
Aug 24, 2017, 11:08:57 PM
8/24/17
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
How can I filter a variable in a template so that I can extract a fact
Trying to get the default ipv4 address from a template
template.j2
ipv4 address ((ansible_default_ipv4 | grep address}}
A similar format will work via command line but not via a template. Whats the correct formatting required to do something like that via template?
Thanks
Dick Visser
unread,
Aug 25, 2017, 3:20:34 AM
8/25/17
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
ipv4 address {{ ansible_default_ipv4.address }}
> --
> 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
ansible-proje...@googlegroups.com
.
> To post to this group, send email to
ansible...@googlegroups.com
.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/05c67110-b81c-4bd0-bd3a-04007f24697c%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
--
Dick Visser
GÉANT
Want to join us? We're hiring:
https://www.geant.org/jobs
Anfield
unread,
Aug 25, 2017, 3:50:38 PM
8/25/17
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
That works thanks. I suppose what confused me a little was when trying to do this via command line I had to use grep..
[ansible@localhost exercises]$ ansible local -m setup -a 'filter=ansible_default_ipv4*' | grep address
Reply all
Reply to author
Forward
0 new messages