ansible - 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
解决方案
推荐阅读
- python-3.x - 为什么 pygame 没有检测到我的输入和退格键?
- android - 无法再签署我的 google play 的 apk(jarsigner 不再工作,无法使 apksigner 工作)
- flutter - Flutter - 上下文仅传递给 BottomNavigationBarItem 之一
- python - 如何重用keras功能模型的层级
- selenium - Selenium 循环,表格缺少第一行和最后一列
- c# - 如何在 .NET 的控制器中支持作为 formbody 的继承?
- java - 在 NetBens 中使用 addDateEvaluator() 方法后如何启用 JCalendar 按钮?
- flutter - Flutter:我们在哪里可以使用线性渐变而不是容器
- flutter - 使用 Riverpod 时可以保存全局 ref 对象吗
- javascript - 反应路由器 v6 在组件之外导航