It looks like you already have a directory named "/home/emanuel/file.bz2". You need to remove or rename the existing directory before you can create a file with that same name.
On Friday, December 16, 2022 at 4:43:57 PM UTC-5 [email protected] wrote: > I try, but i see this > > The full traceback is: > Traceback (most recent call last): > File "/usr/lib/python3/dist-packages/ansible/plugins/action/fetch.py", > line 176, in run > f = open(to_bytes(dest, errors='surrogate_or_strict'), 'wb') > IsADirectoryError: [Errno 21] Es un directorio: b'/home/emanuel/file.bz2' > > fatal: [server]: FAILED! => { > "changed": false, > "msg": "Failed to fetch the file: [Errno 21] Es un directorio: > b'/home/emanuel/file.bz2'" > } > > ➜ emanuel ~ whoami > emanuel > > Any suggestions? > > > > On Fri, Dec 16, 2022 at 6:33 PM 'Hearn, Stan J.' via Ansible Project < > [email protected]> wrote: > >> local_user.stdout is a directory that exists. Do you want to replace >> the directory with a file named file.bz2? >> >> >> >> If you are wanting to put the file inside the directory, then add a slash >> to {{ local_user.stdout }}_SLASH_ >> >> >> >> dest: "/home/{{ local_user.stdout }}/" >> >> Regards, >> >> Stan >> >> >> >> *From:* [email protected] <[email protected]> *On >> Behalf Of *SysAdmin EM >> *Sent:* Friday, December 16, 2022 4:15 PM >> *To:* [email protected] >> *Subject:* [EXTERNAL] [ansible-project] Error odule fetch dest is an >> existing directory >> >> >> >> Hi, i use the fetch module to copy files from remote to local: >> >> - delegate_to: localhost >> become: false >> command: whoami >> register: local_user >> >> - name: "copy to local" >> fetch: >> src: "/tmp/file.bz2" >> dest: "/home/{{ local_user.stdout }}" >> flat: true >> >> I see this error: >> >> >> >> The full traceback is: >> NoneType: None >> fatal: [server]: FAILED! => { >> "changed": false, >> "msg": "dest is an existing directory, use a trailing slash if you >> want to fetch src into that directory" >> } >> >> I want to copy the file into my home folder (/home/user). >> >> What am I doing wrong? >> >> Regards, >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/CAGUDtn%3DvGmxjFqKZ8khvYZoJ0M%2BUR_i_-z99Zha8_nZoTDTZLA%40mail.gmail.com >> >> <https://urldefense.com/v3/__https:/groups.google.com/d/msgid/ansible-project/CAGUDtn*3DvGmxjFqKZ8khvYZoJ0M*2BUR_i_-z99Zha8_nZoTDTZLA*40mail.gmail.com?utm_medium=email&utm_source=footer__;JSUl!!Fto3Xw!s2vVZTD1Vf4SIAJoGRGWXny1rzKVUG9MQ_MLxDoxvprsYGXPRHxOLP0be-Arwp2v7pg1G26bq7swov0$> >> . >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/PH0PR10MB55937B419E90E35CF3808F11F0E69%40PH0PR10MB5593.namprd10.prod.outlook.com >> >> <https://groups.google.com/d/msgid/ansible-project/PH0PR10MB55937B419E90E35CF3808F11F0E69%40PH0PR10MB5593.namprd10.prod.outlook.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/19e4751f-bfb3-4cdf-8fbb-719046348fcan%40googlegroups.com.
