Is there doc on how to do this in v2? The equivalent of: from ansible import callbacks from ansible import utils
stats = callbacks.AggregateStats() playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY) runner_cb = callbacks.PlaybookRunnerCallbacks(stats, verbose=utils.VERBOSITY) On Tuesday, July 7, 2015 at 10:01:41 AM UTC-4, Brian Coca wrote: > > "from ansible import callbacks" is not valid in v2 > > On Tue, Jul 7, 2015 at 9:56 AM, Ethan Merrill <[email protected] > <javascript:>> wrote: > > Ok, can you please try this simple test and let me know if you see the > same? > > > > Start with new ubuntu machine > > $ git clone git://github.com/ansible/ansible.git --recursive > > $ cd ./ansible > > $ sudo make install > > $ python > >>>> from ansible import callbacks > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > ImportError: cannot import name callbacks > >>>> > > > > > > On Monday, July 6, 2015 at 4:28:42 PM UTC-4, Brian Coca wrote: > >> > >> we have not finished porting allt he callbacks, the API has changed a > >> bit, but the default ones used by ansible and ansible-playbook should > >> be there > >> > >> On Mon, Jul 6, 2015 at 4:25 PM, Ethan Merrill <[email protected]> > wrote: > >> > I see plugins/callback (notice it's singular) and the contents don't > >> > appear > >> > to be the same as the callbacks py/pyc files from earlier. > >> > > >> > Ethan > >> > > >> > On Monday, July 6, 2015 at 4:16:22 PM UTC-4, Brian Coca wrote: > >> >> > >> >> they should be under plugins/callbacks > >> >> > >> >> On Mon, Jul 6, 2015 at 3:39 PM, Ethan Merrill <[email protected]> > >> >> wrote: > >> >> > Hi... > >> >> > > >> >> > I just setup a new ubuntu system to run from source using the > "sudo > >> >> > make > >> >> > install" command. When I try to run scripts that use "from > ansible > >> >> > import > >> >> > callbacks" Python gives an error that callbacks doesn't exist. If > I > >> >> > just > >> >> > try running the following from the command line I get the same: > >> >> > > >> >> > vagrant@precise64:~/ansible$ python > >> >> > Python 2.7.3 (default, Jun 22 2015, 19:33:41) > >> >> > [GCC 4.6.3] on linux2 > >> >> > Type "help", "copyright", "credits" or "license" for more > >> >> > information. > >> >> >>>> from ansible import callbacks > >> >> > Traceback (most recent call last): > >> >> > File "<stdin>", line 1, in <module> > >> >> > ImportError: cannot import name callbacks > >> >> >>>> > >> >> > > >> >> > However importing other things like ansible utils does work. > >> >> > > >> >> > I notice that there are no longer any callback py or pyc files in > >> >> > > >> >> > > /usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible/: > >> >> > > >> >> > > >> >> > > >> >> > > vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ > > > >> >> > ll > >> >> > total 112 > >> >> > drwxr-sr-x 18 root staff 4096 Jul 6 19:32 ./ > >> >> > drwxr-sr-x 4 root staff 4096 Jul 6 19:32 ../ > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 cli/ > >> >> > drwxr-sr-x 3 root staff 4096 Jul 6 19:32 compat/ > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 config/ > >> >> > -rwxr-xr-x 1 root staff 15580 Jul 6 19:32 constants.py* > >> >> > -rw-r--r-- 1 root staff 13616 Jul 6 19:32 constants.pyc > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 errors/ > >> >> > drwxr-sr-x 3 root staff 4096 Jul 6 19:32 executor/ > >> >> > drwxr-sr-x 3 root staff 4096 Jul 6 19:32 galaxy/ > >> >> > -rwxr-xr-x 1 root staff 765 Jul 6 19:32 __init__.py* > >> >> > -rw-r--r-- 1 root staff 242 Jul 6 19:32 __init__.pyc > >> >> > drwxr-sr-x 3 root staff 4096 Jul 6 19:32 inventory/ > >> >> > drwxr-sr-x 4 root staff 4096 Jul 6 19:32 modules/ > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 module_utils/ > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 new_inventory/ > >> >> > drwxr-sr-x 5 root staff 4096 Jul 6 19:32 parsing/ > >> >> > drwxr-sr-x 3 root staff 4096 Jul 6 19:32 playbook/ > >> >> > drwxr-sr-x 12 root staff 4096 Jul 6 19:32 plugins/ > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 template/ > >> >> > drwxr-sr-x 3 root staff 4096 Jul 6 19:32 utils/ > >> >> > drwxr-sr-x 2 root staff 4096 Jul 6 19:32 vars/ > >> >> > > >> >> > > >> >> > > vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ > > > >> >> > > >> >> > Are callbacks being referenced differently now? > >> >> > > >> >> > Ethan > >> >> > > >> >> > -- > >> >> > 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/daf6990b-e940-4096-ad97-9256a1a7d509%40googlegroups.com. > > > >> >> > For more options, visit https://groups.google.com/d/optout. > >> >> > >> >> > >> >> > >> >> -- > >> >> 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 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/e4229b86-0dc0-47f3-aaf0-17677bfb17a7%40googlegroups.com. > > > >> > > >> > For more options, visit https://groups.google.com/d/optout. > >> > >> > >> > >> -- > >> 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 emails from it, send > an > > email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/ansible-project/473c5dea-5c5b-48cd-ab34-4de6002c7765%40googlegroups.com. > > > > > > For more options, visit https://groups.google.com/d/optout. > > > > -- > 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 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/b997fd59-ed62-4d49-9525-e0c41b4863b0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
