Macでansibleをやってみたけど

ansibleの簡単な講習をうけたので、ぜひ使おうということで、Macに入れてみた。

 

インベントリファイルに記載して、いざ実行。

 

ansible -i inventory dev001.example.local -m ping


The authenticity of host 'dev001.example.local (192.168.1.100)' can't be established.
RSA key fingerprint is 22:85:51:e4:1f:64:1d:05:75:04:2e:ed:d3:62:1f:4e.
Are you sure you want to continue connecting (yes/no)? yes
dev001.example.local | FAILED => 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

 

あれ?おかしい。

どうもデフォルトではクライアントのいまのユーザ名で接続して、ダメだったら.sshを見に行ってカギを使ってる?

 

ansible.cfgをつくってないからかなー。デフォルトは/etc/配下だって書いてあるサイトがあったけど、うちのMac上はない。

仕方ないから、よくわからないけど、手で作ってみた。

 

cat ./ansible.cfg
remote_user=testuser

 

これだけのファイル。

 

実行してみたら、以下のエラーがでた。。。。。

ConfigParser.MissingSectionHeaderError: File contains no section headers.

 

やっぱりansible.cfgの書き方が悪いみたい。。

うちのMacにはデフォルトのansible.cfgは入ってないみたいだし。

だれか、デフォルトのansible.cfgの全文をください。。