fatal: [winserver1.foo.com]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_name": "win_lineinfile"
},
"msg": "Destination c:\\temp\\ansible-windows_base.log does not exist !"
}
changed: [winserver1.foo.com] => {
"backup": "",
"changed": true,
"encoding": "utf-8",
"invocation": {
"module_name": "win_lineinfile"
},
"msg": "line added"
}
- hosts: all tasks: - name: create file win_file: path: 'c:\temp\ansible-windows_base.log' state: touch
- name: win_lineinfile test win_lineinfile: dest: 'c:\temp\ansible-windows_base.log' create: true line: 'test-{{ ansible_hostname }}-{{ ansible_date_time.iso8601 }}' regexp: 'test-{{ ansible_hostname }}-' state: present
TASK [create file] ******
changed: [winserver1.foo.com] => {
"changed": true,
"invocation": {
"module_name": "win_file"
}
}
TASK [win_lineinfile test] ******
changed: [winserver1.foo.com] => {
"backup": "",
"changed": true,
"encoding": "utf-16",
"invocation": {
"module_name": "win_lineinfile"
},
"msg": "line added"
}