Foreman 3.x with smart_proxy_salt

Hi all,

I want to install Foreman 3.1 with salt, but noticed there is no smart_proxy_salt in the foreman-plugins EL repository: Index of /plugins/3.1/el7/x86_64

Is it correct that there is no smart_proxy_salt plugin available for this Foreman version?

Unfortunately, there was a build issue for the salt plugin in 3.1 and we were able to fix this issue only yesterday.
Have a look at Index of /plugins/nightly/el7/x86_64 - they should be compatible with 3.1.

Thanks! I’ll try that package.

Will it be added to the 3.1 repository as well when it is stable?

I just started to do this. See PR:

1 Like

Thanks again, that is perfect!

2 Likes

What is needed to move the pull-requests forward?

I do have one finding with the upload-salt-reports command in this version:

$> upload-salt-reports 
/opt/rh/rh-ruby27/root/usr/bin/ruby: error while loading shared libraries: libruby.so.2.7: cannot open shared object file: No such file or directory

It looks like there is more to it than just missing dependencies. There seems to be a special salt wrapper where:

  1. upload-salt-reports (python) uses salt_python_wrapper (ruby) as its hashbang
  2. salt_python_wrapper (ruby) , which loads salt_python_wrapper (shellscript) from the gem (and interprets it as ruby code?).
  3. salt_python_wrapper (shellscript) tries to locate the active python version on the system to execute the python code with.

I’m not a ruby expert, but changing the hashbang in /usr/bin/salt_python_wrapper to #!/usr/bin/tfm-ruby seems to help a bit.

But still, the salt_python_wrapper tries to load the shellscript as ruby code, which seems to fail.

I’ve found the following pull request which might help to solve this: Remove py2/3 distinction script by bastian-src · Pull Request #76 · theforeman/smart_proxy_salt · GitHub

However that pull request drops python2 support, so I don’t know if that is an option for this smart_proxy_salt version.

This is strange.

upload-salt-reports is a python script and uses the salt_python_wrapper because it need to choose between python2 / 3.

Actually, I don’t understand why the ruby error occurs that it can not find the libruby.so.2.7. Do you have a backtrace?

No, there is no backtrace, just this single error message.

I did note different hashbangs in foreman-node and salt_python_wrapper:

foreman_node:

#!/usr/bin/tfm-ruby

salt_python_wrapper:

#!/opt/rh/rh-ruby27/root/usr/bin/ruby

I don’t know if that is an expected difference? Changing it seems to fix the error libruby.so.2.7 error to get one step further in the process.

This should fix the issue: https://github.com/theforeman/foreman-packaging/pull/7552

1 Like

Thanks! I’ll try it when the package is available.

The change is to use tfm-ruby.

1 Like