On 4/2/20 12:08 PM, lolO lolO wrote:
> Hello Racke,
>
> here 's my git tasks:
> =====
> tasks:
> - name: git local actions
> shell: |
> git config --global
user.name "save...@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 g...@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 g...@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 save...@skylab.local:savetogit/devbackupdesconfigs.git
Regards
Racke
>
>
>
>
> Le jeudi 2 avril 2020 09:35:01 UTC+2, lolO lolO a écrit :
>
> 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 g...@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?
>
> ---
> the aim is to push to a remote git (skylab.local)
> as the user 'savetogit'
> this works perfectly ion console
>
> thanks
>
>
https://groups.google.com/d/msgid/ansible-project/0fc9cc86-18b4-457e-880f-296d255c4eb0%40googlegroups.com
> <
https://groups.google.com/d/msgid/ansible-project/0fc9cc86-18b4-457e-880f-296d255c4eb0%40googlegroups.com?utm_medium=email&utm_source=footer>.