Request your help

Hi All,

I am trying to store the output of the ansible task into MySQL database, at present i am able to store the output of the task which does not contain with_items , but not able to store the data for the task which contains with_item, I used the below method, and i am getting the below warnings and the output is “None”. “updateLog” is a function which is used to update the output into the database

def v2_runner_item_on_ok(self, result):
okStatus = True
updateLog(result, okStatus)
pass

[WARNING]: Failure using method (v2_runner_item_on_ok) in callback plugin (<ansible.plugins.callback./Playbooks/TEST/db.CallbackModule object at 0x7fa4a3631cf8>): expected string or bytes-like object

From,
Vino.B

When you use with_items, the result is a list of results. So you will need to call updateLog for each item in the list.

What does updateLog do?
It’s probably trying to access a particular attribute. Just check whether that attribute is a list or string. If it is a list, call updateLog on each item in the list.

Regards,
Matt