problem with shell module and actual command passed

Hello all !

it’s been a while i have troubles with the shell module:
as a command is correctly executed in console (even launched as the user awx)

git push git@savetogit.skylab.local:savetogit/devbackupdesconfigs.git

but fails through the playbook execution with the output

i’ve already tried a lot of changes (character protection, command line in variable, local script)
same issue
the output is

ssh: Could not resolve hostname savetogit.skylab.local: Name or service not know

any idea why such a parsing?

Hello all !

it's been a while i have troubles with the shell module:
as a command is correctly executed in console (even launched as the user awx)

/git push git@savetogit.skylab.local:savetogit/devbackupdesconfigs.git/

but fails through the playbook execution with the output

i've already tried a lot of changes (character protection, command line in variable, local script)
same issue
the output is
ssh: Could not resolve hostname savetogit.skylab.local: Name or service not know

any idea why such a parsing?

How does your playbook / task look like? In the Git URL above you have savetogit.skylab.local,
but below you say you want to push to skylab.local.

Regards
           Racke

Hello Racke,

here 's my git tasks:

Hello Racke,

here 's my git tasks:

tasks:
- name: git local actions
shell: |
git config --global user.name "savetogit@babel.local"
git add -A
git commit -m "Ajout des nouveaux fichiers au repo"
exit 0

  args:
    chdir: "\{\{ workingdir \}\}"

\- name: git push to remote
  shell: "git push git@savetogit\.skylab\.local:savetogit/devbackupdesconfigs\.git"

  args:
    chdir: "\{\{ workingdir \}\}"

 
  register: gitcommand\_return
  changed\_when: gitcommand\_return\.stdout is not search\('nothing to commit'\)
  failed\_when: "'FAILED' in gitcommand\_return\.stderr"

====

my gitlab server is skylab.local
the syntax *git push git@savetogit.skylab.local:savetogit/devbackupdesconfigs.git *allows to push with another ssh user
credential (user = savetogit)
it works fine in console

I think the correct push command for the remote user savetogit would be:

git push savetogit@skylab.local:savetogit/devbackupdesconfigs.git

Regards
        Racke

in console :

-bash-4.2$ whoami
awx
-bash-4.2$ git push git@savetogit.skylab.local:savetogit/devbackupdesconfigs.git
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 503 bytes | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
To git@savetogit.skylab.local:savetogit/devbackupdesconfigs.git

bcbe3ed…2cfbb27 master → master

-bash-4.2$ git push savetogit@skylab.local:savetogit/devbackupdesconfigs.git
savetogit@skylab.local’s password:

this second command doesn’t work with ssh keys and asks password