LoginSignup
3
3

More than 5 years have passed since last update.

ansible-playbookコマンドでsshが繋がるのにssh errorが出た際の解決策

Posted at

前提

  • vagrant上で2つのARTACK/debian-jessieを構築
  • 鍵の交換は済ませており、sshで入れる
  • ansible-playbook -i hosts -m pingが成功する
  • git cloneで取得したplaybook

エラー

GATHERING FACTS ***************************************************************
fatal: [192.168.33.12] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue

解決策

対象のplaybookがrootを前提としていた為でした。
Debian Jessie 8.1.0 Release x64 (Minimal, Guest Additions 4.3.26)にはrootユーザが存在しない為に上記のエラーが出ます。

# 変更前
- hosts: all
  user: root

管理者権限はsudoで付ける事にします。

# 変更後
- hosts: all
  sudo: yes

簡単な事ですが、表示されるエラーと原因が直接結びつかない場合ちょっと戸惑いますね。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3