Choose smartproxy for remote execution

Problem:
We have some machines that our main katello instance cannot reach over ssh, so we added a smartproxy to use with that machines.
But now all the remote execution jobs are going through the secondary smartproxy (which cannot reach all the machines) so it is failing for several machines.

Expected outcome:

Foreman and Proxy versions:
Both servers:
foreman: 2.3.3
katello: 3.18.2

Foreman and Proxy plugin versions:

Distribution and version:
Both servers:
CentOS Linux release 7.9.2009 (Core)

Other relevant data:

In order to try to sort this out we tried several things:

  • change the hosts Content Source to the correct smartproxy: it did not work
  • remove the secondary smartproxy from the Default Location but it says that the Location is being used by a host (the host is the secondary smartproxy)

We also found that thereā€™s an option: Enable Global Proxy with the description:
Search for remote execution proxy outside of the proxies assigned to the host. The search will be limited to the hostā€™s organization and location.
So it appears to be possible to assign a smartproxy to a host, but we did not find the option.

How can we avoid this situation and assign hosts to smartproxies?

Thanks in advance.

Best regards,
Armindo Silva.

I think usually youā€™ll set up a subnet and assign the proxy to be used. Then you set up the host with this subnet. That way the host should use the proxies assigned to the subnetā€¦

Hello gvde,

Besides using a subnet is there any other option?
I am asking this, because we have several locations and weā€™re planning to add an smartproxy for each. And on the some of the locations we have the same subnets. So using a subnet to define the smartproxy and we will have the same problem again.

I donā€˜t know. I guess you have to wait for a developer for a definite answer on that.

I think you can set up multiple subnets in foreman on the same or overlapping IP networks. So you can create subnet A for 192.168.1.0/24 in location A and subnet B for the same in location B.

How foreman decides which proxy to use for remote execution is described here Managing Hosts

1 Like

Hello,
I was able to sort this out by creating a location for the machines that are ā€œbehindā€ the smartproxy and changing the smartproxy to only be on the new location.
Actually removing the smartproxy from the default location did not work, so we had to remove it and re-add it manually using the web interface.

Thank you all for your help.

Best regards,
Armindo Silva.