Thanks for your answer, it opens my sight but I still do not copy content to file on disk. I tried copy module again but it did not work. My playbook and output are below.
---
- name: cp file
hosts: all
tasks:
- name: copying a file
slurp: #win_copy:
src: c:\test\b.txt #win_copy: #win_copy:
register: test #dest: /tmp # src: c:\test\a.txt
- name: dosya ici
debug:
msg: "{{ test['content'] | b64decode }}"
- local_action:
module: copy
content: "{{ test['content'] | b64decode }}"
dest: /tmp/ba.txt
/////////// debug output /////////////
{
"msg": "adfasdf", // contains of my file
"changed": false,
"_ansible_verbose_always": true,
"_ansible_no_log": false
}
//////////////// local_action output //////////////////////////
{
"changed": true,
"uid": 998,
"_ansible_delegated_vars": {
"ansible_host": "localhost"
},
"dest": "/tmp/ba.txt",
"owner": "awx",
"diff": [],
"size": 7,
"src": "/var/lib/awx/.ansible/tmp/ansible-tmp-1624704662.69-19-50577674979617/source",
"group": "awx",
"_ansible_no_log": false,
"checksum": "f88f94f974393a32cedc172ea3f7f4affb82f4c2",
"md5sum": "b4206b74b7563ec684336f054582605b",
"state": "file",
"gid": 995,
"secontext": "system_u:object_r:tmp_t:s0",
"mode": "0644",
"invocation": {
"module_args": {
"directory_mode": null,
"force": true,
"remote_src": null,
"dest": "/tmp/ba.txt",
"selevel": null,
"_original_basename": "tmpl88RWo",
"delimiter": null,
"regexp": null,
"owner": null,
"follow": false,
"validate": null,
"local_follow": null,
"src": "/var/lib/awx/.ansible/tmp/ansible-tmp-1624704662.69-19-50577674979617/source",
"group": null,
"unsafe_writes": null,
"checksum": "f88f94f974393a32cedc172ea3f7f4affb82f4c2",
"seuser": null,
"serole": null,
"content": null,
"setype": null,
"mode": null,
"attributes": null,
"backup": false
}
}
}
26 Haziran 2021 Cumartesi tarihinde saat 00:05:24 UTC+3 itibarıyla
weiye...@gmail.com şunları yazdı: