使用 Salt 部署 Vagrant VM

问题描述

我们有一堆 Vagrantfile,我们想开始使用 Salt 进行部署。我们找到了这些说明 here

并遵循他们的流程(安装 salt-cloud,创建提供程序文件配置文件)。但是,当我们运行命令 (salt-cloud -p vagrant-profile new-vm) 时,我们会收到以下错误

[DEBUG   ] return event: {'vmhost': {'ret': "ERROR executing 'vagrant.get_ssh_config': No Vagrant machine defined for Salt_id new-vm",'out': 'nested','retcode': 1,'jid': '20210702034015059875'}}
[DEBUG   ] jid 20210702034015059875 found all minions {'vmhost'}
[DEBUG   ] Closing IPcmessageSubscriber instance
[ERROR   ] There was a profile error: 'str' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/cloud/cli.py",line 290,in run
    ret = mapper.run_profile(self.options.profile,self.config.get("names"))
  File "/usr/lib/python3.6/site-packages/salt/cloud/__init__.py",line 1407,in run_profile
    ret[name] = self.create(vm_)
  File "/usr/lib/python3.6/site-packages/salt/cloud/__init__.py",line 1228,in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python3.6/site-packages/salt/loader.py",line 1235,in __call__
    return self.loader.run(run_func,*args,**kwargs)
  File "/usr/lib/python3.6/site-packages/salt/loader.py",line 2268,in run
    return self._last_context.run(self._run_as,_func_or_method,**kwargs)
  File "/usr/lib/python3.6/site-packages/contextvars/__init__.py",line 38,in run
    return callable(*args,line 2283,in _run_as
    return _func_or_method(*args,**kwargs)
  File "/usr/lib/python3.6/site-packages/salt/cloud/clouds/vagrant.py",line 242,in create
    if "private_key" not in vm_ and ret and ret.get("private_key",False):
AttributeError: 'str' object has no attribute 'get'

有没有其他人有这方面的经验?我们如何解决这个问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...