Vercon92
Vercon92

Reputation: 1

How to automaticly show salt minions in Foreman?

I did set up salt and Foreman like described in the Installation guides on a RHEL7 machine (https://repo.saltstack.com/#rhel, https://theforeman.org/manuals/1.21/index.html#2.Quickstart and https://www.theforeman.org/plugins/foreman_salt/7.0/index.html)

The problem is that i don´t see my salt-minions in Foreman. I would except the salt-minions to show up in foreman ("all hosts") as soon as they are accepted by the salt-master. Does anyone know how salt and foreman are working together on this matter?

Foreman knows the salt-master because it is configured as smart Proxy in foreman. When the salt master Need to accept some minion-key it can be done by foreman. Maybe the salt-master needs to report the new minions somehow to foreman...

Upvotes: 0

Views: 445

Answers (1)

Vercon92
Vercon92

Reputation: 1

Found the error in /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>'

I found out that the problem here is that somehow the minion id instad of the minion hostname is checked in /usr/share/gems/gems/smart_proxy_salt-2.1.9/bin/foreman-node. My minion id was something like 'myprojekt_myenv_hostname.exmaple.com' and it doesn´t pass the regex, so salt throws "Invalid hostname (RuntimeError)".

After changing the minion to it´s hostname they appeared in Foreman.

Upvotes: 0

Related Questions