【发布时间】:2018-02-04 23:00:39
【问题描述】:
我想在本地运行一个 python 脚本,并打印(调试)输出。在 ansible 之外运行脚本给了我这个:
$ python ../scripts/test-winrm-v5.py
i-746726df
这是我的剧本:
$ cat test4.yml
- name: list instance ids
hosts: all
gather_facts: false
tasks:
local_action: shell python ../scripts/test-winrm-v5.sh
register: result
debug: msg="{{ result }}"
这是我运行 playbook 时得到的结果:
$ ansible-playbook -i ../inventory/phani test4.yml
PLAY [list instance ids] ******************************************************
PLAY RECAP ********************************************************************
为什么不显示脚本的输出?
【问题讨论】:
-
更正:将剧本中的 .sh 更改为 .py,但没有任何区别。
标签: ansible