我试图测试 salt-cloud
saltify
在目标机器上部署/安装salt-minions .
我创建了三个流浪汉机器并命名为 master , minion-01 和 minion-02 .
所有的机器都是这样的;
root@master:/home/vagrant# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
然后在主人我跟着这个http://repo.saltstack.com/#ubuntu安装salt-master(手动的) .
然后在master中我添加了这三个文件 .
在 /etc/salt/cloud.providers:
root@master:/etc/salt/cloud.providers.d# cat bare_metal.conf
my-saltify-config:
minion:
master: 192.168.33.10
driver: saltify
在 /etc/salt/cloud.profiles.d:
root@master:/etc/salt/cloud.profiles.d# cat saltify.conf
make_salty:
provider: my-saltify-config
script_args: git v2016.3.1
/etc/salt/saltify-map
root@master:/etc/salt# cat saltify-map
make_salty:
- minion-01:
ssh_host: 192.168.33.11
ssh_username: vagrant
password: vagrant
- minion-02:
ssh_host: 192.168.33.12
ssh_username: vagrant
password: vagrant
然后在minion我跑了 salt-cloud -m /etc/salt/saltify-map
它非常缓慢,但它运行没有错误 . 盐主人接受了minion-01和minion-02的钥匙 .
我能做到这一点:
root@master:/home/vagrant# salt 'minion*' test.ping
minion-01:
True
minion-02:
True
还有这个;
root@master:/home/vagrant# salt-key
Accepted Keys:
minion-01
minion-02
Denied Keys:
Unaccepted Keys:
Rejected Keys:
The Problem;
现在,当我再次执行这个 salt-cloud -m /etc/salt/saltify-map
salt-master重新执行整个执行时,我就有了这个;
root@master:/home/vagrant# salt 'minion*' test.ping
minion-02:
Minion did not return. [No response]
minion-01:
Minion did not return. [No response]
还有这个;
root@master:/etc/salt# salt-key
Accepted Keys:
minion-01
minion-02
Denied Keys:
minion-01
minion-02
Unaccepted Keys:
Rejected Keys:
简而言之,盐 Cloud 不起作用 idempotent .
我究竟做错了什么 ?
第二个问题是,虽然在第一次运行 salt-cloud -m /etc/salt/saltify-map
安装并接受salt-master上的 minion-01 和 minion-02 的键,但是minion机器安装了所有这些东西以及 salt-minion
root@minion-02:/home/vagrant# salt
salt salt-call salt-cp salt-master salt-proxy salt-ssh salt-unity
salt-api salt-cloud salt-key salt-minion salt-run salt-syndic
如何确保仅安装 salt-minion
.
谢谢 .
PS:
root@master:/etc/salt# salt-master --version
salt-master 2016.3.1 (Boron)
4 回答
You write: "It was very slow" :
您已将
script_args
设置为从源安装Github的所有内容的值 . 您可能希望删除参数(或使用不同的参数)以快速安装预打包版本 . 有关可用选项,请参阅https://github.com/saltstack/salt-bootstrap,特别是bootstrap-salt.sh
.You write: "salt-cloud is not acting idempotent" :
你正确地做了一切 .
salt-cloud
不是幂等的 . 据我所知,它并非旨在成为幂等的 .You write: "the minion machines have all these things installed along with salt-minion"
可能是因为使用了
git
参数并从源代码安装它 . 请尝试预先打包的Salt版本 .Vagrant不会在运行之间销毁机器,是吗?
从它的外观来看,在第二次运行时,盐爪已经开始使用新钥匙并重新注册到主人 . 因为他们有相同的名字,所有人都感到困惑.....
在跑步前尝试“流浪汉摧毁”,这样机器每次都是新鲜的吗?
FWIW,这也被记录为Salt中的一个错误,但目前它不能重复:https://github.com/saltstack/salt/issues/34687
它似乎是一个
saltify
错误 . 所以,对这个问题无能为力 . 报告了该错误,希望这将在未来的版本中得到解决 .