Previously, ansible2.4 can run normally, and after upgrading 2.5, it is wrong. As long as win_copy is executed, the win_template will report the error.
Run again, because win_copy skips, there is no problem.
yml:
- hosts: appserver
tasks:
- name: 创建目录({{RTServicePath}}/RTService)
win_copy:
src: /var/lib/awx/projects/trace/RTService/trace_ws_service
dest: “{{RTServicePath}}”
- name: 创建车间服务配置文件
win_template:
src: /var/lib/awx/projects/trace/RTService/templateFile/application_ws.yml.j2
dest: “{{RTServicePath}}\trace_ws_service\application.yml”
error info:
task path: /var/lib/awx/projects/trace/test.yml:13
11:42:00
<192.168.227.224> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 192.168.227.224
EXEC (via pipeline wrapper)
EXEC (via pipeline wrapper)
The full traceback is:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py”, line 138, in run
res = self._execute()
File “/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py”, line 554, in _execute
result = self._handler.run(task_vars=variables)
File “/usr/lib/python2.7/dist-packages/ansible/plugins/action/template.py”, line 137, in run
local_tempdir = tempfile.mkdtemp(dir=C.DEFAULT_LOCAL_TMP)
File “/usr/lib/python2.7/tempfile.py”, line 339, in mkdtemp
_os.mkdir(file, 0700)
OSError: [Errno 2] No such file or directory: ‘/var/lib/awx/.ansible/tmp/ansible-local-3lHNKtn/tmpkJHb84’
fatal: [192.168.227.224]: FAILED! => {
“msg”: “Unexpected failure during module execution.”,
“stdout”: “”
}