【问题标题】:How to automaticly show salt minions in Foreman?如何在 Foreman 中自动显示 salt minion?
【发布时间】:2019-04-09 17:28:10
【问题描述】:

我确实按照 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 和 Foreman

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

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

【问题讨论】:

    标签: salt-stack salt foreman theforeman


    【解决方案1】:

    在 /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>'
    

    我发现这里的问题是 minion id instad minion hostname 是签入 /usr/share/gems/gems/smart_proxy_salt-2.1.9/bin/foreman-node。我的 minion id 类似于“myprojekt_myenv_hostname.exmaple.com”,它没有通过正则表达式,所以 salt 会抛出“Invalid hostname (RuntimeError)”。

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

    【讨论】:

      猜你喜欢
      • 2016-11-14
      • 1970-01-01
      • 1970-01-01
      • 2017-11-13
      • 1970-01-01
      • 2023-01-26
      • 1970-01-01
      • 1970-01-01
      • 2015-04-09
      相关资源
      最近更新 更多