Hi! Anyone have any advice on developing a vars_plugin? This may sound
kinda screwy, but for a chef -> ansible transition I need to access data
from a chef data_bag in an ansible play . . . I'm able to get the chef
data using pychef, but I'm having issues when trying to run the code within
vars_plugin code:
import chef
def get_dbag_data():
chef_api = chef.autoconfigure()
dbag, dbag_item = 'dbag', 'dbag_item'
bag = chef.DataBag(dbag) # some debugging shows the problem is here on
the second run. . !
item = bag[dbag_item]
return item.to_dict()
The code above works outside of ansible, but when run in ansible it seems
to get run twice, and fails on the "bag = chef.DataBag(dbag)" line the
second time around.
Any thoughts would be greatly appreciated!
Thanks!
Guy
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CABnTgtWLOnLrA0jn45n8HtDave37UDo8PbHe2JV9iU6yd5Kqrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.