का उपयोग करके एकाधिक निर्देशिकाएं बनाएं I test2 के लिए समान रूप से 2 उप निर्देशिका (/ home/test1/bin और/home/test2/conf) के साथ एकाधिक निर्देशिका (test1, test2) बनाना चाहते हैं। मेरे प्लेबुक इस तरह दिखता है:उत्तरदायी
--
- hosts: localhost
tasks:
- name: Create directory
file: path=/home/{{item}}/bin state=directory
file: path=/home/{{item}}/conf state=directory
with_items:
- test1
- test2
हालांकि मैं निम्नलिखित त्रुटि मिलती है:
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/root/ansible/lib/ansible/executor/process/worker.py", line 122, in run
executor_result = TaskExecutor(host, task, job_vars, new_play_context, self._new_stdin, self._loader, shared_loader_obj).run()
File "/root/ansible/lib/ansible/executor/task_executor.py", line 89, in run
items = self._get_loop_items()
File "/root/ansible/lib/ansible/executor/task_executor.py", line 179, in _get_loop_items
items = self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self._loader, templar=templar).run(terms=loop_terms, variables=vars_copy)
File "/root/ansible/lib/ansible/plugins/lookup/items.py", line 26, in run
return self._flatten(terms)
TypeError: _flatten() takes exactly 2 arguments (1 given)
fatal: [localhost]: FAILED! => {"failed": true, "stdout": ""}
क्या यहां मुद्दा यह है? मैं नवीनतम गिट चेकआउट का उपयोग कर रहा हूं। क्या इस दृष्टिकोण के लिए कोई बेहतर तरीका है?
आप अपने कोड है कि समस्या दे रहा है की लाइन दिखा सकते हैं? स्पष्ट रूप से आप कुछ फ़ंक्शन में एक तर्क खो रहे हैं। – dasjkdj
@victor मैंने उपर्युक्त कार्य के लिए कोई कोड नहीं लिखा है, मैं इसे करने के लिए केवल उत्तरदायी मॉड्यूल का उपयोग कर रहा हूं। – jugal