Невозможно SSH на сервер с Ansible.Невозможно SSH на сервер с Ansible
$ ansible myserver -m ping -u username\@company.com -vvvvv
Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
<ip.ad.dr.es> ESTABLISH SSH CONNECTION FOR USER: [email protected]
<ip.ad.dr.es> SSH: ansible.cfg set ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<ip.ad.dr.es> SSH: ANSIBLE_REMOTE_PORT/remote_port/ansible_port set: (-o)(Port=22)
<ip.ad.dr.es> SSH: ANSIBLE_PRIVATE_KEY_FILE/private_key_file/ansible_ssh_private_key_file set: (-o)(IdentityFile="/Users/username/.ssh/id_rsa")
<ip.ad.dr.es> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<ip.ad.dr.es> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)([email protected])
<ip.ad.dr.es> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<ip.ad.dr.es> SSH: PlayContext set ssh_common_args:()
<ip.ad.dr.es> SSH: PlayContext set ssh_extra_args: (-A)
<ip.ad.dr.es> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/Users/username/.ansible/cp/ansible-ssh-%h-%p-%r)
<ip.ad.dr.es> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o Port=22 -o 'IdentityFile="/Users/username/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o [email protected] -o ConnectTimeout=10 -o ControlPath=/Users/username/.ansible/cp/ansible-ssh-%h-%p-%r ip.ad.dr.es '/bin/sh -c '"'"'(umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1469804843.87-104204648028091 `" && echo ansible-tmp-1469804843.87-104204648028091="` echo $HOME/.ansible/tmp/ansible-tmp-1469804843.87-104204648028091 `") && sleep 0'"'"''
ip.ad.dr.es | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh.",
"unreachable": true
}
Возможность входа на тот же сервер вручную с помощью SSH с моего Mac.
ssh -p 22 -A -i ~/.ssh/id_rsa username\@[email protected] -X -C
Любая идея о том, как устранить эту проблему дальше?
Просмотрел /var/log/auth.log на этом сервере и не нашел файл. Не уверен, какой другой файл посмотреть, чтобы посмотреть, что происходит.
Edit # 1: Также это сделал -
ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s)(-o)(ForwardAgent=yes)
т.е. добавили ForwardAgent = да к ssh_args, и удалила --ssh-экстра-арг = "- A". Это тоже не помогло.
Попробуйте 'ANSIBLE_DEBUG = 1 ansible myserver -m ping -u имя_пользователя \ @ company.com -vvvv' - он может дать некоторые подсказки –
у вас работает Ansible с вашего Mac тоже? – tedder42
@ tedder42 - да, я на Mac работает El Capitan v10.11.6, а версия - 2.1.1.0. –