Strategies 控制task的执行方式, 在2.0中增加了"free" Strategies, 可以允许每个host尽快的执行完一个play. 默认是Strategies是linear, 表示任何host必须等待所有的host完成一个task后才能开始执行下一个task
Strategies 还有一个debug模式, debug模式在2.1中才能使用.
PLAY *************************************************************************** TASK [wrong variable] ********************************************************** fatal: [192.168.1.1]: FAILED! => {"failed": true, "msg": "ERROR! 'wrong_var' is undefined"} Debugger invoked (debug) p result {'msg': u"ERROR! 'wrong_var' is undefined", 'failed': True} (debug) p task.args {u'data': u'{{ wrong_var }}'} (debug) task.args['data'] = '{{ var1 }}' (debug) p task.args {u'data': '{{ var1 }}'} (debug) redo ok: [192.168.1.1] PLAY RECAP ********************************************************************* 192.168.1.1 : ok=1 changed=0 unreachable=0 failed=0
可用的debug命令
- p task/vars/host/result
Print values used to execute a module:
- task.args[key] = value
Update module’s argument.
- vars[key] = value
Update vars. -
c(ontinue)
Just continue. - q(uit)
Quit from the debugger. The playbook execution is aborted.