setup/facts stopped working after a few run testing on callback feature.
####sample playbook###
[root@localhost ansible]# cat local.yml
---
- hosts: 127.0.0.1
gather_facts: True
tasks:
- name: testing
command: uptime
[root@localhost ansible]# ansible-playbook -i hosts local.yml
PLAY [127.0.0.1] **************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [testing] ***************************************************************
changed: [127.0.0.1]
PLAY RECAP ********************************************************************
127.0.0.1 : ok=2 changed=1 unreachable=0 failed=0
############ callback testing code ########
def runner_on_ok(self, host, res):
invocation = res.get('invocation', None)
facts = res.get('ansible_facts', None)
with open('/tmp/runner_ok.out', 'w') as infile:
#if invocation.get('module_name') == 'setup':
infile.write("running on %s" % host)
infile.write("result is %s" % invocation)
infile.write("facts are %s" % facts)
infile.write("results are %s" % res)
[root@localhost ansible]# cat /tmp/runner_ok.outrunning on 127.0.0.1result is {'module_name': 'command', 'module_args': 'uptime'}facts are Noneresults are {u'changed': True, u'end': u'2014-07-09 14:52:57.339048', u'stdout': u' 14:52:57 up 1:11, 1 user, load average: 0.00, 0.00, 0.00', u'cmd': [u'uptime'], u'rc': 0, u'start': u'2014-07-09 14:52:57.335572', u'stderr': u'', u'delta': u'0:00:00.003476', 'invocation': {'module_name': 'command', 'module_args': 'uptime'}}
--
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/22bf1331-2493-45d8-93e1-d9cda5450c84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hmm, don't see why that would be the case.Reading this - there is a on "on_setup" callback, but the "on_runner_ok" one should still fire.
Better topic for ansible-devel in the future, BTW, if you don't mind.