0
下面的代码运行正常,直到它的错误出在本地保存任务Ansible跳绳任务,因为未定义的错误
- local_action: file dest=firewallinfo.txt state=touch
- name: "Gather firewall information"
script: firewall.sh
register: output
- debug: var=output
- name: Firewall Name
raw: hostname
register: output2
- debug: var=output2
- name: the file
raw: cat "{{item}}".csv
with_items: '{{output2.stdout_lines}}'
register: output3
- debug: var=output3
这是我的代码停止工作。有人知道为什么
- name: save locally
local_action: lineinfile dest=firewallinfo.txt line="{{item}}"
with_items: '{{output3.stdout_lines}}'
你会得到任何输出吗? – Railslide
我得到的调试 - 调试:var = output3工作,但当我尝试采取output3的stdout_lines并把它放入一个文件,它给了我这个错误[拒绝警告]:由于未定义的错误跳过任务,在未来这将是一个致命错误。此功能将在未来版本中删除。可以通过在ansible.cfg中设置 deprecation_warnings = False来禁用弃用警告。 – ehuck