質問編集履歴
2
見づらかったので修正\(Markdown記法を\)
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,11 +8,14 @@
|
|
8
8
|
##やりたいことの下準備
|
9
9
|
- PlayBookにInventoryファイルを作成し、下記内容を記載
|
10
10
|
|
11
|
+
```
|
11
|
-
|
12
|
+
ホスト名 ansible_hosts=AmazonLinuxのIPアドレス ansible_port=22 ansible_user=ec2-user ansible_ssh_private_key_file=/Users/ユーザー名/鍵ファイル名
|
13
|
+
```
|
12
14
|
|
13
15
|
- ~/.ssh/configに下記内容を追記
|
14
16
|
|
17
|
+
```
|
15
|
-
|
18
|
+
Host ホスト名
|
16
19
|
HostName AmazonLinuxのIPアドレス
|
17
20
|
User ec2-user
|
18
21
|
Port 22
|
@@ -21,7 +24,8 @@
|
|
21
24
|
PasswordAuthentication no
|
22
25
|
IdentityFile /Users/ユーザー名/鍵ファイル名
|
23
26
|
IdentitiesOnly yes
|
24
|
-
LogLevel FATAL
|
27
|
+
LogLevel FATAL
|
28
|
+
```
|
25
29
|
|
26
30
|
##やったこととエラー内容
|
27
31
|
ローカルのMacからリモートのAmazonLinuxに対してansibleでpingを飛ばすために下記コマンドを実行しましたが、エラーが出てしまいます。
|
1
見づらかったので修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -32,7 +32,8 @@
|
|
32
32
|
`ansible all -i hosts -m ping -vvvv`
|
33
33
|
|
34
34
|
エラー内容
|
35
|
+
```
|
35
|
-
|
36
|
+
Loading callback plugin minimal of type stdout, v2.0 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/ansible/plugins/callback/__init__.py
|
36
37
|
Using module file /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/ansible/modules/core/system/ping.py
|
37
38
|
<AmazonLinuxのIPアドレス> ESTABLISH SSH CONNECTION FOR USER: ec2-user
|
38
39
|
<AmazonLinuxのIPアドレス> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o Port=22 -o 'IdentityFile="/Users/ユーザー名/鍵ファイル名"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/Users/ユーザー名/.ansible/cp/ansible-ssh-%h-%p-%r ec2-52-192-25-117.ap-northeast-1.compute.amazonaws.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1491825137.680528-27969382201002 `" && echo ansible-tmp-1491825137.680528-27969382201002="` echo ~/.ansible/tmp/ansible-tmp-1491825137.680528-27969382201002 `" ) && sleep 0'"'"''
|
@@ -40,7 +41,8 @@
|
|
40
41
|
"changed": false,
|
41
42
|
"msg": "Failed to connect to the host via ssh: OpenSSH_6.9p1, LibreSSL 2.1.8\r\ndebug1: Reading configuration data /Users/ユーザー名/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\nControlPath too long\r\n",
|
42
43
|
"unreachable": true
|
44
|
+
}
|
43
|
-
|
45
|
+
```
|
44
46
|
|
45
47
|
以上となります。
|
46
48
|
他に必要な情報がありましたらお手数ですが、コメントしていただけると嬉しいです。
|