Re: [ansible-project] action_plugin/ vs library/ module

2016-01-27 Thread Mike Biancaniello
IYI, my eventual solution involves creating a blank change-mgmt ticket with a callback_plugin in init(). I then store the ticket number that is created in __main__.cli.ticket_number. Then, the first pre-task of my playbook calls my action_plugin to read the ticket_number from __main__.cli and

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-26 Thread Mike Biancaniello
Ok, so the problem I'm having in making this a callback is that I want to open a ticket on playbook start and close it on stats. In order to open the ticket, I need certain information that will be specific to the playbook being run. The only way I can find to pass vars is through play_vars,

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-22 Thread Peter Sprygada
>From the sounds of it, developing a callback might be more appropriate. http://docs.ansible.com/ansible/developing_plugins.html#callbacks On Fri, Jan 22, 2016 at 1:13 PM, Mike Biancaniello wrote: > So, it looks like, in my case, I'll want an action plugin since I don't >

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-22 Thread Mike Biancaniello
So, it looks like, in my case, I'll want an action plugin since I don't really need anything run on a remote machine and I'll need access to the results of the playbook. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-22 Thread Mike Biancaniello
I actually started out to create a callback that triggered on change, but after some internal discussion, decided that I didn't want it to fire after each task, but rather, wanted to run it one time in the beginning and once at the end, so I figured that calling it as a task would be more

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-22 Thread Mike Biancaniello
I also notice that there seem to be a lot of action_plugins for core modules. It doesn't look like modules have access to ansible __main__ data (e.g. if --diff was passed on the cmdline). If I need that data, might I need an action_plugin? -- You received this message because you are

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-22 Thread Mike Biancaniello
Perhaps. I'll probably build both and see which feels better. I need to be able to set vars for the plugin/module to use that might be different for each playbook. The callback_plugins have access to vars through the 'invocation' in res, right? I'll also need access to all of the diffs, so

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-22 Thread Brian Coca
It still sounds like you want a callback, you can just implement the on_start and on_stat methods and ignore all the intermediate actions -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

[ansible-project] action_plugin/ vs library/ module

2016-01-21 Thread Mike Biancaniello
So, what's the deal with action_plugins? There is very little documentation on their purpose. Observations: 1. If action_plugin/foo.py and library/foo.py both exist, then only action_plugin/foo.py gets called (the plugin *may* call the module if it wants, but that is not by default). 2. If

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-21 Thread Brian Coca
99% of the time you want a module, action plugins normally are created when you need to do work on the 'master' machine. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving