where do i put a custom iterator?

137 views
Skip to first unread message

Guy Matz

unread,
Oct 1, 2014, 4:38:53 PM10/1/14
to ansible...@googlegroups.com
ansible-playbook --version
ansible-playbook 1.8 (devel 1d3a8bd39c) last updated 2014/09/18 10:33:54 (GMT -400)

Hi!
I've written a custom iterator that works when I put it in ansible/lib/ansible/runner/lookup_plugins, however I can't seem to get it found when I put it with my playbooks . . .  does anyone know where it should go?

Thanks!

James Cammarata

unread,
Oct 1, 2014, 5:29:07 PM10/1/14
to ansible...@googlegroups.com
Hi Guy, 

If this is a lookup plugin, you should be able to put it in a directory named "lookup_plugins" at the same location as the playbook. I can't find any documentation or code referencing this working in roles though, so I don't believe you can embed lookup plugins in a role at this time (which you can do with modules).

Thanks!

--
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/CABnTgtUfC2kLK8y0pXLfx%2ByGV9cjZxWTArte1_RO83nddmjE5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Guy Matz

unread,
Oct 1, 2014, 5:47:14 PM10/1/14
to ansible...@googlegroups.com
Awesome!  yes, so moving my plugin, 12fcmds, to ansible_root/lookup_plugins/12fcmds.py allowed me to use the plugin as:

- name: Test of with_cmd
  template: src=cmd.j2 dest=/tmp/{{ item.key }}.txt
  with_12fcmds: test_var
  tags: test

This reply is mostly for posterity . . .

Thanks!!
Guy

Reply all
Reply to author
Forward
0 new messages