如何解决使用 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 举报,一经查实,本站将立刻删除。