質問編集履歴

5

コード追記

2020/06/02 07:14

投稿

papachiropa
papachiropa

スコア15

test CHANGED
File without changes
test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ```エラー
8
8
 
9
- [root@hoge tmp]# ansible-playbook playbook.yml -i hosts
9
+ [root@hoge tmp]# ansible-playbook OracleJDK.yml -i hosts
10
10
 
11
11
 
12
12
 
@@ -150,7 +150,7 @@
150
150
 
151
151
  ```
152
152
 
153
- [root@KVHKAP02 tmp]# ansible-playbook OracleJDK.yml -i hosts
153
+ [root@hoge tmp]# ansible-playbook OracleJDK.yml -i hosts
154
154
 
155
155
 
156
156
 

4

コード追記

2020/06/02 07:13

投稿

papachiropa
papachiropa

スコア15

test CHANGED
File without changes
test CHANGED
@@ -144,4 +144,56 @@
144
144
 
145
145
  ```
146
146
 
147
+
148
+
149
+ 6/2時点エラー状況
150
+
151
+ ```
152
+
153
+ [root@KVHKAP02 tmp]# ansible-playbook OracleJDK.yml -i hosts
154
+
155
+
156
+
157
+ PLAY [tomcat] ************************************************************************************************************************************
158
+
159
+
160
+
161
+ TASK [create target dir.] ************************************************************************************************************************
162
+
163
+ Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa':
164
+
165
+ ok: [linux3]
166
+
167
+
168
+
169
+
170
+
171
+ fatal: [linux1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", "unreachable": true}
172
+
173
+
174
+
175
+ TASK [copy] **************************************************************************************************************************************
176
+
177
+
178
+
179
+ ok: [linux3]
180
+
181
+
182
+
183
+ TASK [install JDK 14 from a local file] **********************************************************************************************************
184
+
185
+ ok: [linux3]
186
+
187
+ to retry, use: --limit @/tmp/OracleJDK.retry
188
+
189
+
190
+
191
+ PLAY RECAP ***************************************************************************************************************************************
192
+
193
+ linux1 : ok=0 changed=0 unreachable=1 failed=0
194
+
195
+ linux3 : ok=3 changed=0 unreachable=0 failed=0
196
+
197
+ ```
198
+
147
199
  宜しくお願い致します。

3

コード追記

2020/06/02 07:12

投稿

papachiropa
papachiropa

スコア15

test CHANGED
File without changes
test CHANGED
@@ -102,4 +102,46 @@
102
102
 
103
103
  ```
104
104
 
105
+ 端折って申し訳ございません。実行予定のplaybookは下記です。
106
+
107
+ ```YAML
108
+
109
+ - hosts: tomcat
110
+
111
+ vars:
112
+
113
+   ansible_user: root
114
+
115
+   ansible_ssh_private_key_file: /root/.ssh/id_rsa
116
+
117
+ gather_facts: no
118
+
119
+ remote_user: root
120
+
121
+ become: true
122
+
123
+ tasks:
124
+
125
+ - name: create target dir.
126
+
127
+ file: path=/root/soft state=directory
128
+
129
+ - copy:
130
+
131
+ src=/tmp/jdk-8u202-linux-x64.rpm
132
+
133
+ dest=/root/soft/jdk-8u202-linux-x64.rpm
134
+
135
+ owner=root
136
+
137
+ group=root
138
+
139
+ mode=0644
140
+
141
+ - name: install JDK 14 from a local file
142
+
143
+ yum: name=/root/soft/jdk-8u202-linux-x64.rpm state=present
144
+
145
+ ```
146
+
105
147
  宜しくお願い致します。

2

誤記修正

2020/06/02 05:43

投稿

papachiropa
papachiropa

スコア15

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- サーバA(192.168.100.251)とB(192.168.100.251)に対して
1
+ サーバA(192.168.100.251)とB(192.168.100.253)に対して
2
2
 
3
3
  Ansible playbookを実行すると下記のようなエラーが出ます。(Ansible操作端末も対象サーバもCentOS7です)
4
4
 

1

書式改善

2020/06/01 10:15

投稿

papachiropa
papachiropa

スコア15

test CHANGED
File without changes
test CHANGED
@@ -78,7 +78,9 @@
78
78
 
79
79
  [root@hoge tmp]# ansible all -m ping -i hosts
80
80
 
81
- Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': 192.168.100.253 | SUCCESS => {
81
+ Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa':
82
+
83
+ 192.168.100.253 | SUCCESS => {
82
84
 
83
85
  "changed": false,
84
86