我使用 vagrant 来测试我的 salt 配置。在一个盒子上我有一个流浪的盐大师和盐奴才,在另一个盒子上我有一个盐奴才。
我正在尝试切换到使用 gitfs 从我的私人仓库中获取后端。
这是我的salt.master_config
:
hash_type: sha256
auto_accept: True
roster_file: /srv/salt/roster
fileserver_backend:
- roots
- git
file_roots:
base:
- /srv/salt/environments/base/files
- /srv/salt/environments/base/states
- /srv/salt/users
gitfs_remotes:
- git@github.com:user/repo.git
- pubkey: /srv/salt/environments/base/files/.ssh/id_rsa.pub
- privkey: /srv/salt/environments/base/files/.ssh/id_rsa
- https://github.com/salt/users-formula.git
- https://github.com/salt/openssh-formula.git
其他 gitfs 遥控器过去一直有效,但新的遥控器不接受 ssh 密钥。跑步时sudo salt '*' state.apply
我得到:
ERROR ] Error parsing configuration file: /etc/salt/master - mapping values are not allowed here
in "<string>", line 16, column 13:
- pubkey: /srv/salt/environments/base/fi
我还尝试使用vagrantup prosvisioning 文档https://www.vagrantup.com/docs/provisioning/salt.html中的主选项,并将master_pub和master_key添加到我的:Vagrantfile
master.vm.provision :salt do |salt|
salt.install_master = true
salt.master_pub = 'id_rsa.pub'
salt.master_key = 'id_rsa'
salt.install_type = 'stable'
salt.master_config = 'master'
salt.minion_config = 'salt-local'
end
但这是为了 ssh 到 vagrant box,而不是实际用于 gitfs。
您如何为 vagrant 配置文件提供 ssh 凭据?