how to solve it Ansible 2.9 git Permission denied (publickey).\r\nfatal: The remote end hung up unexpectedly

Here is my ansible Version

>
ansible 2.9.7

config file =/Users/jeongwookko/git/ansible.cfg

configured modulesearch path =['/Users/jeongwookko/.ansible/plugins/modules','/usr/share/ansible/plugins/modules']

ansible python modulelocation =/usr/local/Cellar/ansible/2.9.7/libexec/lib/python3.8/site-packages/ansible

executable location =/usr/local/bin/ansible

python version =3.8.2(default,Mar112020,00:29:50)[Clang11.0.0(clang-1100.0.33.17)]

>

cat ansible.cfg

>
[defaults]

deprecation_warnings=False

hostfile =hosts/main

ask_sudo_pass =False

ask_pass =True

pipelining =True

gatherging =True

poll_interval=20

record_host_keys=False

fact_caching_timeout =86400

transport =ssh

forks=100

log_path=ansible.log

poll_intervals=20

display_skipped_hosts =False

host_key_checking =False

sudo_flags =-HEs

[ssh_connection]

ssh_args=-o ForwardAgent=yes -o StrictHostKeyChecking=no-o UserKnownHostsFile=/dev/null-o LogLevel=ERROR -o
ConnectTimeout=120

scp_if_ssh=True

#ansible_ssh_private_key_file=.
>

when ansible-playbook

>

task path:/Users/jeongwookko/git/roles/site/symfony/tasks/main.yml

-git:repo=git@git.aaa.com:xxxxxxx version={{site_branch }}dest={{site_repo_root }}accept_hostkey=yes force=no

-get_url:url=https://getcomposer.org/installer dest=/tmp/composer_installer mode=0777

-shell:/usr/bin/php /tmp/composer_installer --install-dir=/usr/bin

-command:mv /usr/bin/composer.phar /usr/bin/composer

-composer:command=install working_dir={{site_repo_root }}no_dev=no

>

*it occurs error below *

>
TASK [site/symfony
:git]*****************************************************************************************************************************************************************

task path:/Users/jeongwookko/git/roles/site/symfony/tasks/main.yml:1

Thefull traceback is:

WARNING:Thebelow traceback may *not*be related to the actual failure.

File"/tmp/ansible_git_payload_0MMVFf/ansible_git_payload.zip/ansible/modules/source_control/git.py",line 461,inclone

File"/usr/lib64/python2.6/os.py",line 157,inmakedirs

mkdir\(name,mode\)

fatal:[xxxxxxx]:FAILED!=>{

"changed":false,

"cmd":"/usr/bin/git clone \-\-origin origin '' /var/www/xxxxxxx",

"invocation":\{

    "module\_args":\{

        "accept\_hostkey":true,

        "archive":null,

        "bare":false,

      �� "clone":true,

        "depth":null,

        "dest":"/var/www/xxxxxxx",

        "executable":null,

        "force":false,

        "gpg\_whitelist":\[\],

        "key\_file":null,

        "recursive":true,

        "reference":null,

        "refspec":null,

        "remote":"origin",

        "repo":"git@git\.aaa\.com:xxxxxxx",

        "separate\_git\_dir":null,

        "ssh\_opts":null,

        "track\_submodules":false,

        "umask":null,

        "update":true,

        "verify\_commit":false,

        "version":"dev\_20200521"

    \}

\},

"msg":"Permission denied \(publickey\)\.\\r\\nfatal: The remote end hung up unexpectedly",

"rc":128,

"stderr":"Permission denied \(publickey\)\.\\r\\nfatal: The remote end hung up unexpectedly\\n",

"stderr\_lines":\[

    "Permission denied \(publickey\)\.",

    "fatal: The remote end hung up unexpectedly"

\],

"stdout":"Initialized empty Git repository in /var/www/controlWeb/\.git/\\n",

"stdout\_lines":\[

    "Initialized empty Git repository in /var/www/controlWeb/\.git/"

\]

}

>

*please help me anybody*

*
*

*how to solve it?*

*
*

*I did search it about two days but I can't find any solution of it*

It looks to me that the ansible user on the target machine doesn't have access to the Git repository (lack of private
key?).

Regards
         Racke

Thank you for your answer

I missed some comments so I delete and change my text

I’m really sorry about that

2020년 5월 22일 금요일 오후 6시 2분 55초 UTC+9, Stefan Hornburg (Racke) 님의 말: