Access facts in custom filter plugin

28 views
Skip to first unread message

Łukasz Górski

unread,
Feb 2, 2016, 8:21:17 AM2/2/16
to Ansible Project
Hi there,

First post here, if something is amiss on my part, please bear with me.

How do I access facts in my own filter plugin? I know I can (and did) write a function and pass the fact as an argument, but perhaps it is possible to get the fact's value in the body of a filter function?

My specific use case is something like 'fqdn_rand' in Puppet, but I guess if I had the facts accessible in plugins, I would just write more plugins to hide some more complicated or ugly things :)

Thanks in advance.

Best regards,
Łukasz Górski

Brian Coca

unread,
Feb 2, 2016, 9:41:06 AM2/2/16
to Ansible Project
filter plugins don't have access to anything except the arguments
passed directly:

arg1 | filter(arg2, arg3, ...)



--
Brian Coca

Łukasz Górski

unread,
Feb 3, 2016, 5:23:11 AM2/3/16
to Ansible Project
I hoped for some clever hack... Thanks anyway :)

Best regards,
Łukasz Górski
Reply all
Reply to author
Forward
0 new messages