Hello Racke,

here 's my git tasks: 
=====
tasks:  
    - name: git local actions
      shell: |  
        git config --global user.name "[email protected]"
        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 
[email protected]: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 
[email protected]:savetogit/devbackupdesconfigs.git *allows to 
push with another ssh user credential (user = savetogit)
it works fine in console





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 [email protected]: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
>

-- 
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/0fc9cc86-18b4-457e-880f-296d255c4eb0%40googlegroups.com.

Reply via email to