Ansible:并行部署剧本时出错

时间:2019-03-28 20:57:58

标签: ansible

我正在用ansible建立一个kubernetes集群。 运行良好。

现在我通常有2或3个群集,我可以用它们测试不同的东西。

通常在某个时间点群集/服务器损坏。如果发生这种情况,我通常会重新创建服务器,然后再次启动剧本。因为这需要一些时间,所以我希望能够并行运行2个或更多剧本。

但是每次我这样做时,都会出现以下错误:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: FileNotFoundError: [Errno 2] No such file or directory

我这样运行我的剧本:

  "$ansible_playbook"
    -i "${ANSIBLE_HOSTS}"
    "${ANSIBLE_YML}"
    --flush-cache
    --user root
    --become
    --become-user root
    --ask-sudo-pass

错误的原因可能是什么?

我可以想象,ansible在后台创建了一些文件,供不同的剧本使用。但是那可能是哪些文件?

提前谢谢!

更新更详细的错误日志(-vvv)

ansible-playbook 2.7.8
  config file = /home/mod/cod/wo/thingylabs/kubernetes-provisioning/playbooks/test1/ansible.cfg
  configured module search path = ['/home/mod/cod/wo/thingylabs/kubernetes-provisioning/vendors/kubespray/library']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.7.2 (default, Jan 10 2019, 23:51:51) [GCC 8.2.1 20181127]
Using /home/mod/cod/wo/thingylabs/kubernetes-provisioning/playbooks/test1/ansible.cfg as config file
SUDO password:
ERROR! Unexpected Exception, this is probably a bug: [Errno 2] No such file or directory
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", 
    exit_code = cli.run()
  File "/usr/lib/python3.7/site-packages/ansible/cli/playbook.py", line 104, in run
    loader, inventory, variable_manager = self._play_prereqs(self.options)
  File "/usr/lib/python3.7/site-packages/ansible/cli/__init__.py", line 786, in _play_prereqs
    inventory = InventoryManager(loader=loader, sources=options.inventory)
  File "/usr/lib/python3.7/site-packages/ansible/inventory/manager.py", line 148, in __init__
    self.parse_sources(cache=True)
  File "/usr/lib/python3.7/site-packages/ansible/inventory/manager.py", line 207, in parse_sources
    source = unfrackpath(source, follow=False)
  File "/usr/lib/python3.7/site-packages/ansible/utils/path.py", line 47, in unfrackpath
    basedir = op.getcwd()
FileNotFoundError: [Errno 2] No such file or directory

0 个答案:

没有答案