質問編集履歴

1

エラーメッセージの修正

2022/09/01 00:17

投稿

riho1128
riho1128

スコア22

test CHANGED
File without changes
test CHANGED
@@ -1,5 +1,6 @@
1
+ ※エラーメッセージの記述を間違えていた為、修正しました。
1
2
 
2
- いつも助けて頂いてありがとうございます。下記を実現する方法がもしあれば教えて頂けると助かります。自身も本当に出来るのかわからず探りながらやってます(´;ω;`)
3
+ いつも助けて頂いてありがとうございます。下記を実現する方法がもしあれば教えて頂けると助かります。自身も本当に出来るのかわからず探りながらやってます
3
4
 
4
5
 
5
6
  ### 実現したいこと
@@ -53,70 +54,9 @@
53
54
  -------------------------------------------------------------------------------------------------------
54
55
  ■実行結果&エラーメッセージ
55
56
 
56
- [root@localhost template]# ansible-playbook -i hosts test.yml -vvvv
57
- ansible-playbook [core 2.11.9]
58
- config file = /etc/ansible/ansible.cfg
59
- configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
60
- ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
61
- ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
62
- executable location = /usr/local/bin/ansible-playbook
63
- python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
64
- jinja version = 3.0.3
65
- libyaml = True
66
- Using /etc/ansible/ansible.cfg as config file
67
- setting up inventory plugins
68
- host_list declined parsing /etc/ansible/fortigate/test/template/hosts as it did not pass its verify_file() method
69
- auto declined parsing /etc/ansible/fortigate/test/template/hosts as it did not pass its verify_file() method
70
- Parsed /etc/ansible/fortigate/test/template/hosts inventory source with ini plugin
71
- Loading collection fortinet.fortios from /root/.ansible/collections/ansible_collections/fortinet/fortios
72
- redirecting (type: callback) ansible.builtin.counter_enabled to community.general.counter_enabled
73
- Loading collection community.general from /root/.ansible/collections/ansible_collections/community/general
74
- redirecting (type: callback) ansible.builtin.counter_enabled to community.general.counter_enabled
75
- Loading callback plugin community.general.counter_enabled of type stdout, v2.0 from /root/.ansible/collections/ansible_collections/community/general/plugins/callback/counter_enabled.py
76
- Skipping callback 'default', as we already have a stdout callback.
77
- Skipping callback 'minimal', as we already have a stdout callback.
78
- Skipping callback 'oneline', as we already have a stdout callback.
79
- 1 plays in test.yml
80
-
81
- PLAY [fortigates] ************************************************************************
82
-
83
- TASK 1/3 [Gathering Facts] ***************************************************************
57
+ TASK 2/3 [set_factest] ***********************************************************************************************************
84
- task path: /etc/ansible/fortigate/test/template/test.yml:1
58
+ task path: /etc/ansible/fortigate/test/template/test.yml:12
85
59
  redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
86
- Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
87
- <ansible_host=192.168.1.1> attempting to start connection
88
- <ansible_host=192.168.1.1> using connection plugin ansible.netcommon.httpapi
89
- Found ansible-connection at path /usr/local/bin/ansible-connection
90
- <ansible_host=192.168.1.1> local domain socket does not exist, starting it
91
- <ansible_host=192.168.1.1> control socket path is /root/.ansible/pc/be701deeba
92
- <ansible_host=192.168.1.1> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
93
- <ansible_host=192.168.1.1> Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
94
- <ansible_host=192.168.1.1> local domain socket listeners started successfully
95
- <ansible_host=192.168.1.1>
96
- <ansible_host=192.168.1.1> local domain socket path is /root/.ansible/pc/be701deeba
97
- <ansible_host=192.168.1.1> ESTABLISH LOCAL CONNECTION FOR USER: root
98
- <ansible_host=192.168.1.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-22733w074xrrv `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999 `" && echo ansible-tmp-1661929267.8036003-22747-140663278401999="` echo /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999 `" ) && sleep 0'
99
- Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/setup.py
100
- <ansible_host=192.168.1.1> PUT /root/.ansible/tmp/ansible-local-22733w074xrrv/tmpk6k_0n83 TO /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999/AnsiballZ_setup.py
101
- <ansible_host=192.168.1.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999/ /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999/AnsiballZ_setup.py && sleep 0'
102
- <ansible_host=192.168.1.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999/AnsiballZ_setup.py && sleep 0'
103
- <ansible_host=192.168.1.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-22733w074xrrv/ansible-tmp-1661929267.8036003-22747-140663278401999/ > /dev/null 2>&1 && sleep 0'
104
- ok: 1/1 [ansible_host=192.168.1.1]
105
- META: ran handlers
106
-
107
- TASK 2/3 [set_factest] *******************************************************************
108
- task path: /etc/ansible/fortigate/test/template/test.yml:12
109
- File lookup using /srv/data/parameter.json as file
110
- File lookup using /srv/data/parameter.j2 as file
111
- redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
112
- Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
113
- <ansible_host=192.168.1.1> attempting to start connection
114
- <ansible_host=192.168.1.1> using connection plugin ansible.netcommon.httpapi
115
- Found ansible-connection at path /usr/local/bin/ansible-connection
116
- <ansible_host=192.168.1.1> found existing local domain socket, using it!
117
- <ansible_host=192.168.1.1> updating play_context for connection
118
- <ansible_host=192.168.1.1>
119
- <ansible_host=192.168.1.1> local domain socket path is /root/.ansible/pc/be701deeba
120
60
  ok: 1/1 [ansible_host=192.168.1.1] => {
121
61
  "ansible_facts": {
122
62
  "parameter": {
@@ -128,32 +68,49 @@
128
68
  "changed": false
129
69
  }
130
70
 
131
- TASK 3/3 [debug] *************************************************************************
71
+ TASK 3/3 [debug] *****************************************************************************************************************
132
72
  task path: /etc/ansible/fortigate/test/template/test.yml:15
133
73
  redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
134
- Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
135
- <ansible_host=192.168.1.1> attempting to start connection
136
- <ansible_host=192.168.1.1> using connection plugin ansible.netcommon.httpapi
137
- Found ansible-connection at path /usr/local/bin/ansible-connection
138
- <ansible_host=192.168.1.1> found existing local domain socket, using it!
139
- <ansible_host=192.168.1.1> updating play_context for connection
140
- <ansible_host=192.168.1.1>
141
- <ansible_host=192.168.1.1> local domain socket path is /root/.ansible/pc/be701deeba
142
74
  ok: 1/1 [ansible_host=192.168.1.1] => {
143
- "msg": {
144
- "hostname": "FGT60FTK21035539",
145
- "language": "japanese",
75
+ "msg": "japanese"
146
- "timezone": "60"
147
- }
148
76
  }
149
77
 
150
- TASK 4/3 [system_global] *****************************************************************
78
+ TASK 4/3 [system_global] *********************************************************************************************************
151
79
  task path: /etc/ansible/fortigate/test/template/test.yml:18
80
+ redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
81
+ <ansible_host=192.168.1.1> ESTABLISH LOCAL CONNECTION FOR USER: root
82
+ <ansible_host=192.168.1.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-2547325cxuhn6 `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319 `" && echo ansible-tmp-1661990706.1743524-25588-27745780406319="` echo /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319 `" ) && sleep 0'
83
+ Using module file /root/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_global.py
84
+ <ansible_host=192.168.1.1> PUT /root/.ansible/tmp/ansible-local-2547325cxuhn6/tmpxygvkwnr TO /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py
85
+ <ansible_host=192.168.1.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/ /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py && sleep 0'
86
+ <ansible_host=192.168.1.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py && sleep 0'
87
+ <ansible_host=192.168.1.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/ > /dev/null 2>&1 && sleep 0'
88
+ The full traceback is:
89
+ Traceback (most recent call last):
90
+ File "/root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py", line 100, in <module>
91
+ _ansiballz_main()
92
+ File "/root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py", line 92, in _ansiballz_main
93
+ invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
94
+ File "/root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py", line 41, in invoke_module
95
+ run_name='__main__', alter_sys=True)
96
+ File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
97
+ return _run_module_code(code, init_globals, run_name, mod_spec)
98
+ File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
99
+ mod_name, mod_spec, pkg_name, script_name)
100
+ File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
101
+ exec(code, run_globals)
102
+ File "/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_global.py", line 15222, in <module>
103
+ File "/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_global.py", line 15199, in main
104
+ File "/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible_collections/fortinet/fortios/plugins/module_utils/fortios/fortios.py", line 216, in check_schema_versioning
105
+ File "/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
106
+ ansible.module_utils.connection.ConnectionError: Method not found
152
107
  fatal: 1/1 [ansible_host=192.168.1.1]: FAILED! => {
153
- "msg": "The task includes an option with an undefined variable. The error was: 'language' is undefined\n\nThe error appears to be in '/etc/ansible/fortigate/test/template/test.yml': line 18, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n msg: \"{{ parameter }}\"\n - name: system_global\n ^ here\n"
108
+ "changed": false,
109
+ "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py\", line 100, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py\", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-local-2547325cxuhn6/ansible-tmp-1661990706.1743524-25588-27745780406319/AnsiballZ_fortios_system_global.py\", line 41, in invoke_module\n run_name='__main__', alter_sys=True)\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_global.py\", line 15222, in <module>\n File \"/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_global.py\", line 15199, in main\n File \"/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible_collections/fortinet/fortios/plugins/module_utils/fortios/fortios.py\", line 216, in check_schema_versioning\n File \"/tmp/ansible_fortios_system_global_payload_j54iq53b/ansible_fortios_system_global_payload.zip/ansible/module_utils/connection.py\", line 200, in __rpc__\nansible.module_utils.connection.ConnectionError: Method not found\n",
110
+ "module_stdout": "",
111
+ "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
112
+ "rc": 1
154
113
  }
155
114
 
156
- PLAY RECAP *******************************************************************************
115
+ PLAY RECAP ***********************************************************************************************************************
157
- ansible_host=192.168.1.1 : ok=3 changed=0 unreachable=0 failed=1 rescued=0 ignored=0
116
+ ansible_host=192.168.1.1 : ok=3 changed=0 unreachable=0 failed=1 rescued=0 ignored=0
158
-
159
-