0

我确实设置了 salt 和 Foreman,如 RHEL7 机器上的安装指南中所述(https://repo.saltstack.com/#rhelhttps://theforeman.org/manuals/1.21/index.html#2.Quickstarthttps://www.theforeman.org/plugins/foreman_salt/7.0/index.html

问题是我在工头里看不到我的盐奴。一旦 Salt-master 接受了 salt-minions,我会立即出现在工头(“所有主机”)中。有谁知道 salt 和 foreman 在这件事上是如何合作的?

Foreman 知道 salt-master,因为它在 foreman 中配置为智能代理。当 salt master 需要接受一些 minion-key 时,可以由工头完成。也许盐主需要以某种方式向工头报告新的奴才……

4

1 回答 1

0

在 /var/log/salt/master 中发现错误:

2019-04-09 10:34:49,243 [salt.loaded.int.module.cmdmod:1182][ERROR   ][29609] Command '/usr/bin/foreman-node myprojekt_myenv_hostname.exmaple.com' failed with return code: 1
2019-04-09 10:34:49,244 [salt.loaded.int.module.cmdmod:1187][ERROR   ][29609] output: /usr/share/gems/gems/smart_proxy_salt-2.1.9/bin/foreman-node:187:in `<top (required)>': Invalid hostname (RuntimeError)
        from /usr/bin/foreman-node:23:in `load'
        from /usr/bin/foreman-node:23:in `<main>'

我发现这里的问题是在/usr/share/gems/gems/smart_proxy_salt-2.1.9/bin/foreman-node 中检查了minion主机名的minion id instad 。我的 minion id 类似于“myprojekt_myenv_hostname.exmaple.com”,它没有通过正则表达式,所以 salt 会抛出“无效的主机名(RuntimeError)”。

在将 minion 更改为其主机名后,它们出现在 Foreman 中。

于 2019-04-09T09:22:48.170 回答