質問編集履歴

3

ansible オプションを `-vvvv` に変更しました。

2016/11/16 03:36

投稿

shigel
shigel

スコア11

test CHANGED
File without changes
test CHANGED
@@ -42,10 +42,18 @@
42
42
 
43
43
  ```
44
44
 
45
- [root@localhost ansible]# ansible-playbook test.yml --limit=vagrant --connection=local -v
45
+ [root@localhost ansible]# ansible-playbook test.yml --limit=vagrant --connection=local -vvvv
46
46
 
47
47
  Using /vagrant/ansible/ansible.cfg as config file
48
48
 
49
+ Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc
50
+
51
+
52
+
53
+ PLAYBOOK: test.yml *************************************************************
54
+
55
+ 1 plays in test.yml
56
+
49
57
 
50
58
 
51
59
  PLAY [all] *********************************************************************
@@ -54,14 +62,40 @@
54
62
 
55
63
  TASK [setup] *******************************************************************
56
64
 
65
+ Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
66
+
67
+ <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
68
+
69
+ <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728 `" && echo ansible-tmp-1479267155.59-84022657785728="` echo $HOME/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728 `" ) && sleep 0'
70
+
71
+ <127.0.0.1> PUT /tmp/tmpKJgvMU TO /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/setup.py
72
+
73
+ <127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/ /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/setup.py && sleep 0'
74
+
75
+ <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/" > /dev/null 2>&1 && sleep 0'
76
+
57
77
  ok: [127.0.0.1]
58
78
 
59
79
 
60
80
 
61
81
  TASK [test : create groups debug] **********************************************
62
82
 
83
+ task path: /vagrant/ansible/roles/test/tasks/main.yml:2
84
+
63
85
  ok: [127.0.0.1] => (item=user_groups) => {
64
86
 
87
+ "invocation": {
88
+
89
+ "module_args": {
90
+
91
+ "var": "user_groups"
92
+
93
+ },
94
+
95
+ "module_name": "debug"
96
+
97
+ },
98
+
65
99
  "item": "user_groups",
66
100
 
67
101
  "user_groups": [
@@ -98,7 +132,15 @@
98
132
 
99
133
  TASK [test : create groups debug] **********************************************
100
134
 
101
- fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'gid'\n\nThe error appears to have been in '/vagrant/ansible/roles/test/tasks/main.yml': line 7, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create groups debug\n ^ here\n"}
135
+ task path: /vagrant/ansible/roles/test/tasks/main.yml:7
136
+
137
+ fatal: [127.0.0.1]: FAILED! => {
138
+
139
+ "failed": true,
140
+
141
+ "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'gid'\n\nThe error appears to have been in '/vagrant/ansible/roles/test/tasks/main.yml': line 7, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create groups debug\n ^ here\n"
142
+
143
+ }
102
144
 
103
145
  to retry, use: --limit @/vagrant/ansible/test.retry
104
146
 
@@ -108,6 +150,10 @@
108
150
 
109
151
  127.0.0.1 : ok=2 changed=0 unreachable=0 failed=1
110
152
 
153
+
154
+
155
+ [root@localhost ansible]#
156
+
111
157
  ```
112
158
 
113
159
 

2

ansibleのエラーメッセージを見やすいように切り出し

2016/11/16 03:36

投稿

shigel
shigel

スコア11

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,32 @@
16
16
 
17
17
  ```
18
18
 
19
+ the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'gid'
20
+
21
+
22
+
23
+ The error appears to have been in '/vagrant/ansible/roles/test/tasks/main.yml': line 7, column 3, but may
24
+
25
+ be elsewhere in the file depending on the exact syntax problem.
26
+
27
+
28
+
29
+ The offending line appears to be:
30
+
31
+
32
+
33
+
34
+
35
+ - name: create groups debug
36
+
37
+ ^ here
38
+
39
+ ```
40
+
41
+
42
+
43
+ ```
44
+
19
45
  [root@localhost ansible]# ansible-playbook test.yml --limit=vagrant --connection=local -v
20
46
 
21
47
  Using /vagrant/ansible/ansible.cfg as config file

1

タイトル誤字

2016/11/16 02:40

投稿

shigel
shigel

スコア11

test CHANGED
@@ -1 +1 @@
1
- ansible環境変数参照時に
1
+ ansible環境変数参照時にエラー
test CHANGED
File without changes