如何在Ansible中获得所需的调试输出?

时间:2018-09-27 06:48:56

标签: ansible

下面是debug的输出。.但是我只需要stdout即可。如何获得??

“ user_90”:{         “已更改”:是,         “失败”:是的,         “ msg”:“所有项目已完成”,         “结果”:[             {                 “ _ansible_item_result”:是的,                 “ _ansible_no_log”:否,                 “ _ansible_parsed”:是的,                 “已更改”:是,                 “ cmd”:“对于我来说是ansible;请执行lastlog -b 90 | grep -i $ i;完成”                 “ delta”:“ 0:00:00.006069”,                 “ end”:“ 2018-09-27 02:42:08.655181”,                 “失败”:是的,                 “调用”:{                     “ module_args”:{                         “ _raw_params”:“对于ansible中的i;执行lastlog -b 90 | grep -i $ i;完成”,                         “ _uses_shell”:是的,                         “ chdir”:null,                         “创建”:null,                         “可执行”:null,                         “删除”:null,                         “ stdin”:null,                         “警告”:为true                     }                 },                 “ item”:“ ansible”,                 “ msg”:“非零返回码”,                 “ rc”:1,                 “ start”:“ 2018-09-27 02:42:08.649112”,                 “ stderr”:“”,                 “ stderr_lines”:[],                 “ stdout”:“”,                 “ stdout_lines”:[]             },             {                 “ _ansible_ignore_errors”:是的,                 “ _ansible_item_result”:是的,                 “ _ansible_no_log”:否,                 “ _ansible_parsed”:是的,                 “已更改”:是,                 “ cmd”:“对于nkgupta中的i;执行lastlog -b 90 | grep -i $ i;完成”,                 “ delta”:“ 0:00:00.005613”,                 “ end”:“ 2018-09-27 02:42:08.981566”,                 “失败”:错误,                 “调用”:{                     “ module_args”:{                         “ _raw_params”:“对于nkgupta中的i;执行lastlog -b 90 | grep -i $ i;完成”,                         “ _uses_shell”:是的,                         “ chdir”:null,                         “创建”:null,                         “可执行”:null,                         “删除”:null,                         “ stdin”:null,                         “警告”:为true                     }                 },                 “ item”:“ nkgupta”,                 “ rc”:0,                 “ start”:“ 2018-09-27 02:42:08.975953”,                 “ stderr”:“”,                 “ stderr_lines”:[],                 “ stdout”:“ nkgupta 从未登录”,                 “ stdout_lines”:[                     “ nkgupta 从未登录”                 ]             },             {                 “ _ansible_ignore_errors”:是的,                 “ _ansible_item_result”:是的,                 “ _ansible_no_log”:否,                 “ _ansible_parsed”:是的,                 “已更改”:是,                 “ cmd”:“对于我在桑迪中;请执行lastlog -b 90 | grep -i $ i;完成”,                 “ delta”:“ 0:00:00.005321”,                 “ end”:“ 2018-09-27 02:42:09.293261”,                 “失败”:错误,                 “调用”:{                     “ module_args”:{                         “ _raw_params”:“对于桑迪我;请执行lastlog -b 90 | grep -i $ i;完成”,                         “ _uses_shell”:是的,                         “ chdir”:null,                         “创建”:null,                         “可执行”:null,                         “删除”:null,                         “ stdin”:null,                         “警告”:为true                     }                 },                 “ item”:“ sandy”,                 “ rc”:0,                 “ start”:“ 2018-09-27 02:42:09.287940”,                 “ stderr”:“”,                 “ stderr_lines”:[],                 “ stdout”:“桑迪从未登录”,                 “ stdout_lines”:[                     “桑迪从未登录”                 ]             },             {                 “ _ansible_ignore_errors”:是的,                 “ _ansible_item_result”:是的,                 “ _ansible_no_log”:否,                 “ _ansible_parsed”:是的,                 “已更改”:是,                 “ cmd”:“对于我在sandeep中;执行lastlog -b 90 | grep -i $ i;完成”,                 “ delta”:“ 0:00:00.005017”,                 “ end”:“ 2018-09-27 02:42:09.602672”,                 “失败”:错误,                 “调用”:{                     “ module_args”:{                         “ _raw_params”:“对于i在sandeep中;执行lastlog -b 90 | grep -i $ i;完成”,                         “ _uses_shell”:是的,                         “ chdir”:null,                         “创建”:null,                         “可执行”:null,                         “删除”:null,                         “ stdin”:null,                         “警告”:为true                     }                 },                 “ item”:“ sandeep”,                 “ rc”:0,                 “ start”:“ 2018-09-27 02:42:09.597655”,                 “ stderr”:“”,                 “ stderr_lines”:[],                 “ stdout”:“ sandeep 从未登录”,                 “ stdout_lines”:[                     “ sandeep 从未登录”                 ]             },             {                 “ _ansible_ignore_errors”:是的,                 “ _ansible_item_result”:是的,                 “ _ansible_no_log”:否,                 “ _ansible_parsed”:是的,                 “已更改”:是,                 “ cmd”:“对于testuser中的i;执行lastlog -b 90 | grep -i $ i;完成”,                 “ delta”:“ 0:00:00.005029”,                 “ end”:“ 2018-09-27 02:42:09.95578​​5”,                 “失败”:错误,                 “调用”:{                     “ module_args”:{                         “ _raw_params”:“对于testuser中的i;执行lastlog -b 90 | grep -i $ i;完成”,                         “ _uses_shell”:是的,                         “ chdir”:null,                         “创建”:null,                         “可执行”:null,                         “删除”:null,                         “ stdin”:null,                         “警告”:为true                     }                 },                 “ item”:“ testuser”,                 “ rc”:0,                 “ start”:“ 2018-09-27 02:42:09.950756”,                 “ stderr”:“”,                 “ stderr_lines”:[],                 “ stdout”:“测试用户从未登录”,                 “ stdout_lines”:[                     “测试用户从未登录

0 个答案:

没有答案