Problem:
I’d like to setup a smart proxy for a private network. It has two network interfaces: One in the same network as Foreman, and one inside the private network.
The interface inside the “foreman network” has the hostname “puppet-private.example.com”, the interface inside the “private network” has the hostname “puppet.private.example.com”.
I’d like to run the following things on the smart proxy:
- TFTP
- Templates
- Logs
- Puppet
For templates, I can use the “foreman-proxy-template-url” from foreman-installer to specify the internal interface should be used. For TFTP, things will just work if I configure firewall and “next server” correctly.
But I fail to get Foreman to put the correct puppetmaster URL when “@host.puppetmaster” is used in the templates.
What I used on the smart proxy is:
foreman-installer --no-enable-foreman \
--no-enable-foreman-plugin-bootdisk \
--no-enable-foreman-plugin-setup \
--enable-puppet \
--enable-foreman-proxy-plugin-discovery \
--no-enable-foreman-plugin-default-hostgroup \
--foreman-proxy-plugin-discovery-install-images=true \
--puppet-server-ca=false \
--puppet-server-foreman-url=https://foreman.example.com \
--enable-foreman-proxy \
--foreman-proxy-tftp=true \
--foreman-proxy-puppetca=false \
--foreman-proxy-foreman-base-url=https://foreman.example.com \
--foreman-proxy-oauth-consumer-key=something \
--foreman-proxy-oauth-consumer-secret=somethingelse \
--puppet-server-foreman-ssl-ca=/etc/pki/tls/certs/my-private-ca.pem \
--foreman-proxy-trusted-hosts={puppet-private.example.com,foreman.example.com} \
--foreman-proxy-templates=true \
--foreman-proxy-template-url=http://puppet.private.example.com:8000 \
--foreman-proxy-puppet-url=https://puppet.private.example.com:8140 \
--foreman-proxy-registered-name=puppet.private.example.com \
--puppet-dns-alt-names=puppet.private.example.com
I also ensured the puppet cert has both alternate names (i.e. puppet-private.example.com and puppet.private.example.com) which needs manual signing due to Feature #14882: Puppet CA signing should support --allow-dns-alt-names - Smart Proxy - Foreman still being unresolved.
However, when assigning the proxy to a subnet and a host, foreman insists on “@host.puppetmaster” to be “puppet-private.example.com” which the nodes in the private network can not reach.
Is there any way to force Foreman to use “puppet.private.example.com” in the templates?
Foreman and Proxy versions:
1.18.3 (both foreman and proxies)