Hi
On Fri, 15 Jul 2022 at 13:07, dulhaver via Ansible Project
<[email protected]> wrote:
> sorry, you are right I did not provide the -vvv output. I tested this once
> again though and it showed that the copying
>
>
> does not work with dest: " {{ item }} "
I think your definition of "it works" is incorrect, see below
.....
> <vm-xzy.local> ESTABLISH SSH CONNECTION FOR USER: stepuser
> <vm-xzy.local> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o
> ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="stepuser"' -o
> ConnectTimeout=10 -o 'ControlPath="/home/gwagner/.ansible/cp/b5d05b761c"'
> vm-xzy.local> '/bin/sh -c '"'"'rm -f -r
> /home/stepuser/.ansible/tmp/ansible-tmp-1657880906.308936-536971-114267205405617/
> > /dev/null 2>&1 && sleep 0'"'"''
> <vm-xzy.local> (0, b'', b'')
> ok: [vm-xzy.local>] => (item=/etc/pgbackrest/pgbackrest.conf) => changed=false
^^^ This clearly says "ok" so as far as ansible is concerned, things *did* work.
It's not what you expected, but that's because you didn't give ansible
the correct input.
Your loop item is a string that starts with a slash, which, if used as
'dest' parameter for the copy command, is considered an absolute path.
But because of your superfluous spaces it will be considered a *relative* path.
Ansible will try to copy the file to that path, and according to your
logs, that was successful.
It doesn't actually list the full path, but from the logs it will
likely be '/home/stepuser/ /etc/pgbackrest/pgbackrest.conf '.
Note that this includes a directory with a name that is just a space,
which, depending on your shell setup, is not easy to spot - especially
if you don't expect it.
Also the file name will have a trailing space.
One strange thing is that the copy module does not create any parent
directory structures for files, so I wonder how that got created.
--
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/CAF8BbLa_uWRSBSQC3jv6k_b4V_qzqFPWBaeHYzsWwnH1_syi5Q%40mail.gmail.com.