Specify remote execution smart proxy

Problem:
Is there a way to specify which smart proxy is used for SSH remote execution, other than the proxy (or proxy’s) defined in the subnet config?

We have different groups of hosts in the same locations, using the same subnets.
We need to be able to use different smart proxy’s to access these different host groups (using a different user and ssh keys). Is this currently possible?

Thanks in advance for any help.

Expected outcome:

Foreman and Proxy versions:
2.1.2

Foreman and Proxy plugin versions:

Distribution and version:
CentOS 7

Other relevant data:

No, you only have the smart proxy on the subnet, the default and fallback option.

But perhaps you can solve it with the host parameters. You can change the user with remote_execution_ssh_user and some other settings, but I am not sure if remote_execution_ssh_keys allows to override values or is read-only to get all the keys from the smart proxies.

Ok thanks.
I’ve had a bit of a play around and have a workaround until we can segregate the hosts to different subnets properly.

I have created two subnets in foreman for the same network/subnet.
eg. 123_Dev and 123_Prod.
These have different smart proxies assigned to them and my tests so far seem to work ok (ie. Dev hosts are using a different smart proxy, user, ssh key than Prod hosts).

Just to add, is it possible to request this as a new feature?
To allow us to assign smart proxy’s to host groups rather than just subnets?

Yes, of course.
Just add a feature request at Issues - Foreman Remote Execution - Foreman

2 Likes