How to sync yum repos via proxy

Add your proxy’s address to the below files:


:http_proxy: http://yourProxyIP:3128


    host: http://yourProxyIP
    port: 3128
    user: "" # this is not optional
    password: ""


   "proxy_host": "http://yourProxyIP",
   "proxy_port: 3128,
   "proxy_username": null,
   "proxy_password": null,
   "max_speed": null,
   "gpg_sign_metadata": false

Restart foreman


1 Like

One thing I forgot to mention. Make copies of those files as if you run foreman-install again they will get overwritten…

You can also use the installer options for it.

--katello-proxy-password Proxy password for authentication (default: nil)
--katello-proxy-port Port the proxy is running on (default: nil)
--katello-proxy-url URL of the proxy server (default: nil)
--katello-proxy-username Proxy username for authentication (default: nil)
1 Like

Hi there
Juste to add something, if you’re behind a corporate authenticated proxy and use an Active directory user, you’ll need to escape the \ :

"proxy_host": "yourproxy.domain.corp",
"proxy_port": 8080,
"proxy_username": "DOMAIN\\USER",
"proxy_password": "PASSWORD",
"max_speed": null,
"gpg_sign_metadata": false


1 Like

Tried this but when I try to install my first machine, vmlinuz and initrd still sized 0 and :slight_smile:

[root boot]# tail -f /var/log/foreman-proxy/proxy.log
2021-03-05T10:55:56 6fcadf91 [I] [2272] Started task ["/usr/bin/wget", “–connect-timeout=10”, “–dns-timeout=10”, “–read-timeout=60”, “–tries=3”, “–no-check-certificate”, “-nv”, “-c”, “”, “-O”, “/var/lib/tftpboot/boot/centos-8-mirror-ejPIbtG4jFDG-initrd.img”]

Also set HTTP(S) proxy http://myProxy:3128 in the GUI
Machine was also rebooted.
Please where to check further ?

I’ve worked arount by creating /etc/sysconfig/foreman-proxy and set the http_proxy variable inside.
Any idea please of the orthodox way to do it ?

So provided solution above is not working for you because of this is only for foreman itself and katello, but in your case it is Smart proxy TFTP that needs the proxy. I have not found an installer option or even puppet code when looking at it, so this really could be a missing feature or it simply expects a system-wide proxy setting, which Feature #1458: HTTP/HTTPS/FTP Proxy-Support - Smart Proxy - Foreman seams to confirm!

There is a HTTP proxies option in infrastructrure menu. Also tested it but with no result.
The problem is if I set the general variable as mentionned, internal communication does not work anymore.
Whats the purpose of the HTTP proxies variable in the GUI is not this one ?

I had this problem but it seems even if your proxy doesn’t need a user and password it is required in the gui. seem sto be no way to get rid of the user admin and then the sync silently soesn;t do anything as it expects a password if there is a user.