質問編集履歴
5
書式改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
事前に作ったPrivateKey
|
18
18
|
|
19
|
-
```
|
19
|
+
```
|
20
20
|
|
21
21
|
wangzj@wangzj-virtual-machine:~$ ssh-keygen -C Comment
|
22
22
|
|
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
もしかして、/etc/ansible/hostsに設定が足りないでしょうか?
|
88
88
|
|
89
|
-
```
|
89
|
+
```
|
90
90
|
|
91
91
|
wangzj@wangzj-virtual-machine:~$ sudo ansible -m ping all
|
92
92
|
|
@@ -98,7 +98,11 @@
|
|
98
98
|
|
99
99
|
```
|
100
100
|
|
101
|
+
|
102
|
+
|
101
|
-
|
103
|
+
/etc/ansible/hostsの内容↓:
|
104
|
+
|
105
|
+
```
|
102
106
|
|
103
107
|
# This is the default ansible 'hosts' file.
|
104
108
|
|
4
書式改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
実行コマンド:
|
6
6
|
|
7
|
-
```
|
7
|
+
```コマンド
|
8
8
|
|
9
9
|
ansible-playbook -u wangzj --private-key /home/wangzj/.ssh/id_rsa -i inventories/hosts setup.yml
|
10
10
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
事前に作ったPrivateKey
|
18
18
|
|
19
|
-
```
|
19
|
+
```コマンド
|
20
20
|
|
21
21
|
wangzj@wangzj-virtual-machine:~$ ssh-keygen -C Comment
|
22
22
|
|
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
もしかして、/etc/ansible/hostsに設定が足りないでしょうか?
|
88
88
|
|
89
|
-
```
|
89
|
+
```コマンド
|
90
90
|
|
91
91
|
wangzj@wangzj-virtual-machine:~$ sudo ansible -m ping all
|
92
92
|
|
3
内容追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,6 +82,108 @@
|
|
82
82
|
|
83
83
|
```
|
84
84
|
|
85
|
+
sudo ansible -m ping allを実行しました。
|
86
|
+
|
87
|
+
もしかして、/etc/ansible/hostsに設定が足りないでしょうか?
|
88
|
+
|
89
|
+
```
|
90
|
+
|
91
|
+
wangzj@wangzj-virtual-machine:~$ sudo ansible -m ping all
|
92
|
+
|
93
|
+
[sudo] wangzj のパスワード:
|
94
|
+
|
95
|
+
[WARNING]: provided hosts list is empty, only localhost is available. Note
|
96
|
+
|
97
|
+
that the implicit localhost does not match 'all'
|
98
|
+
|
99
|
+
```
|
100
|
+
|
101
|
+
```/etc/ansible/hostsの内容:
|
102
|
+
|
103
|
+
# This is the default ansible 'hosts' file.
|
104
|
+
|
105
|
+
#
|
106
|
+
|
107
|
+
# It should live in /etc/ansible/hosts
|
108
|
+
|
109
|
+
#
|
110
|
+
|
111
|
+
# - Comments begin with the '#' character
|
112
|
+
|
113
|
+
# - Blank lines are ignored
|
114
|
+
|
115
|
+
# - Groups of hosts are delimited by [header] elements
|
116
|
+
|
117
|
+
# - You can enter hostnames or ip addresses
|
118
|
+
|
119
|
+
# - A hostname/ip can be a member of multiple groups
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
# Ex 1: Ungrouped hosts, specify before any group headers.
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
## green.example.com
|
128
|
+
|
129
|
+
## blue.example.com
|
130
|
+
|
131
|
+
## 192.168.100.1
|
132
|
+
|
133
|
+
## 192.168.100.10
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
# Ex 2: A collection of hosts belonging to the 'webservers' group
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
## [webservers]
|
142
|
+
|
143
|
+
## alpha.example.org
|
144
|
+
|
145
|
+
## beta.example.org
|
146
|
+
|
147
|
+
## 192.168.1.100
|
148
|
+
|
149
|
+
## 192.168.1.110
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# If you have multiple hosts following a pattern you can specify
|
154
|
+
|
155
|
+
# them like this:
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
## www[001:006].example.com
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
# Ex 3: A collection of database servers in the 'dbservers' group
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
## [dbservers]
|
168
|
+
|
169
|
+
##
|
170
|
+
|
171
|
+
## db01.intranet.mydomain.net
|
172
|
+
|
173
|
+
## db02.intranet.mydomain.net
|
174
|
+
|
175
|
+
## 10.25.1.56
|
176
|
+
|
177
|
+
## 10.25.1.57
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
# Here's another example of host ranges, this time there are no
|
182
|
+
|
183
|
+
# leading 0s:
|
184
|
+
|
185
|
+
```
|
186
|
+
|
85
187
|
|
86
188
|
|
87
189
|
### 試したこと
|
2
内容追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -94,4 +94,12 @@
|
|
94
94
|
|
95
95
|
3. ホスト名が間違っている。ホスト名が正しいかどうか確認する。
|
96
96
|
|
97
|
+
|
98
|
+
|
99
|
+
terminalにコマンド
|
100
|
+
|
101
|
+
ssh wangzj@192.168.255.5
|
102
|
+
|
103
|
+
でログインしてみました、成功しました。
|
104
|
+
|
97
105
|
上記以外、何か原因がかんがえられますでしょうか?
|
1
内容補足しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
### 試したこと
|
88
88
|
|
89
|
-
下記、確認しました。問題ないはずです
|
89
|
+
下記、確認しました。問題ないはずです。
|
90
90
|
|
91
91
|
1. 間違った鍵で接続しようとしている。キーペアは正しいか確認する
|
92
92
|
|
@@ -94,6 +94,4 @@
|
|
94
94
|
|
95
95
|
3. ホスト名が間違っている。ホスト名が正しいかどうか確認する。
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
97
|
+
上記以外、何か原因がかんがえられますでしょうか?
|