test2と同様に、2つのサブディレクトリ(/ home/test1/binと/ home/test2/conf)を持つ複数のディレクトリ(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": ""}
:私は次のエラーを取得するしかし
--
- hosts: localhost
tasks:
- name: Create directory
file: path=/home/{{item}}/bin state=directory
file: path=/home/{{item}}/conf state=directory
with_items:
- test1
- test2
:私の脚本は、このようになりますか?私は最新のgit checkoutを使用しています。これにアプローチするより良い方法はありますか?
は、あなたが問題を与えているあなたのコードの行を表示することができますか?どうやら、ある関数の引数が1つ欠けているようです。 – dasjkdj
@victor私は上記の作業のためのコードを書いていない、私はそれを完了するために、安全なモジュールを使用しています。 – jugal