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]<mailto:[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.

Reply via email to