teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

コード追記

2020/06/02 07:14

投稿

papachiropa
papachiropa

スコア15

title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,7 @@
2
2
  Ansible playbookを実行すると下記のようなエラーが出ます。(Ansible操作端末も対象サーバもCentOS7です)
3
3
 
4
4
  ```エラー
5
- [root@hoge tmp]# ansible-playbook playbook.yml -i hosts
5
+ [root@hoge tmp]# ansible-playbook OracleJDK.yml -i hosts
6
6
 
7
7
  PLAY *****************************************************************************************************************************
8
8
 
@@ -74,7 +74,7 @@
74
74
 
75
75
  6/2時点エラー状況
76
76
  ```
77
- [root@KVHKAP02 tmp]# ansible-playbook OracleJDK.yml -i hosts
77
+ [root@hoge tmp]# ansible-playbook OracleJDK.yml -i hosts
78
78
 
79
79
  PLAY [tomcat] ************************************************************************************************************************************
80
80
 

4

コード追記

2020/06/02 07:13

投稿

papachiropa
papachiropa

スコア15

title CHANGED
File without changes
body CHANGED
@@ -71,4 +71,30 @@
71
71
  - name: install JDK 14 from a local file
72
72
  yum: name=/root/soft/jdk-8u202-linux-x64.rpm state=present
73
73
  ```
74
+
75
+ 6/2時点エラー状況
76
+ ```
77
+ [root@KVHKAP02 tmp]# ansible-playbook OracleJDK.yml -i hosts
78
+
79
+ PLAY [tomcat] ************************************************************************************************************************************
80
+
81
+ TASK [create target dir.] ************************************************************************************************************************
82
+ Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa':
83
+ ok: [linux3]
84
+
85
+
86
+ 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}
87
+
88
+ TASK [copy] **************************************************************************************************************************************
89
+
90
+ ok: [linux3]
91
+
92
+ TASK [install JDK 14 from a local file] **********************************************************************************************************
93
+ ok: [linux3]
94
+ to retry, use: --limit @/tmp/OracleJDK.retry
95
+
96
+ PLAY RECAP ***************************************************************************************************************************************
97
+ linux1 : ok=0 changed=0 unreachable=1 failed=0
98
+ linux3 : ok=3 changed=0 unreachable=0 failed=0
99
+ ```
74
100
  宜しくお願い致します。

3

コード追記

2020/06/02 07:12

投稿

papachiropa
papachiropa

スコア15

title CHANGED
File without changes
body CHANGED
@@ -50,4 +50,25 @@
50
50
  "unreachable": true
51
51
  }
52
52
  ```
53
+ 端折って申し訳ございません。実行予定のplaybookは下記です。
54
+ ```YAML
55
+ - hosts: tomcat
56
+ vars:
57
+   ansible_user: root
58
+   ansible_ssh_private_key_file: /root/.ssh/id_rsa
59
+ gather_facts: no
60
+ remote_user: root
61
+ become: true
62
+ tasks:
63
+ - name: create target dir.
64
+ file: path=/root/soft state=directory
65
+ - copy:
66
+ src=/tmp/jdk-8u202-linux-x64.rpm
67
+ dest=/root/soft/jdk-8u202-linux-x64.rpm
68
+ owner=root
69
+ group=root
70
+ mode=0644
71
+ - name: install JDK 14 from a local file
72
+ yum: name=/root/soft/jdk-8u202-linux-x64.rpm state=present
73
+ ```
53
74
  宜しくお願い致します。

2

誤記修正

2020/06/02 05:43

投稿

papachiropa
papachiropa

スコア15

title CHANGED
File without changes
body 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
  Ansible playbookを実行すると下記のようなエラーが出ます。(Ansible操作端末も対象サーバもCentOS7です)
3
3
 
4
4
  ```エラー

1

書式改善

2020/06/01 10:15

投稿

papachiropa
papachiropa

スコア15

title CHANGED
File without changes
body CHANGED
@@ -38,7 +38,8 @@
38
38
 
39
39
  #⓶
40
40
  [root@hoge tmp]# ansible all -m ping -i hosts
41
- Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': 192.168.100.253 | SUCCESS => {
41
+ Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa':
42
+ 192.168.100.253 | SUCCESS => {
42
43
  "changed": false,
43
44
  "ping": "pong"
44
45
  }