Cannot get the foreman-installer to run behind a proxy

Problem:
When running the foreman-installer from behind a proxy the foreman-installer cannot get out to the internet to install the required packages
Expected outcome:
The foreman-installer to comeplete and install puppet server along with foreman
Foreman and Proxy versions:
3.12
Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:
Good morning,

I am trying to install Puppet-8 and foreman-3.12 on a RHEL 9 system, I am following the documentation as per Foreman :: Quickstart which says to use the foreman-installer process on a “clean” system as this process does everything for you. When I run foreman-installer I get the following:

foreman-installer

2024-11-22 14:38:28 [WARN ] [boot] [“Unsetting environment variable ‘http_proxy’ for the duration of the install.”]

2024-11-22 14:38:28 [WARN ] [boot] [“Unsetting environment variable ‘https_proxy’ for the duration of the install.”]

2024-11-22 14:38:28 [NOTICE] [root] Loading installer configuration. This will take some time.

2024-11-22 14:38:31 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.

2024-11-22 14:38:31 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.

Failed to ensure foreman-selinux is installed

2024-11-22 14:38:36 [ERROR ] [root] Failed to ensure foreman-selinux is installed

Error: Execution of ‘/bin/dnf -d 0 -e 1 -y install foreman-selinux’ returned 1: Error: Failed to download metadata for repo ‘div10_isd_cyber_repo_isd_cyber_repo’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Error: /Stage[main]/Main/Package[foreman-selinux]/ensure: change from ‘purged’ to ‘present’ failed: Execution of ‘/bin/dnf -d 0 -e 1 -y install foreman-selinux’ returned 1: Error: Failed to download metadata for repo ‘div10_isd_cyber_repo_isd_cyber_repo’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

2024-11-22 14:38:36 [ERROR ] [root] Error: Execution of ‘/bin/dnf -d 0 -e 1 -y install foreman-selinux’ returned 1: Error: Failed to download metadata for repo ‘div10_isd_cyber_repo_isd_cyber_repo’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Error: /Stage[main]/Main/Package[foreman-selinux]/ensure: change from ‘purged’ to ‘present’ failed: Execution of ‘/bin/dnf -d 0 -e 1 -y install foreman-selinux’ returned 1: Error: Failed to download metadata for repo ‘div10_isd_cyber_repo_isd_cyber_repo’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

I am sitting behind a proxy, system firewall is off, I have a /etc/environment file with the proper proxy set, /etc/dnf/dnf.conf has a proxy=http://proxy_name:8080 line and from the OS if I do a “dnf install foreman-selinux” I am asked to install the package and I see the package is coming from the internet. At this point the issue seems to be with foreman-installer and the foreman-installer is unsetting my proxy environment variables. Is there a way to stop this from happening or should I be using a specific option to set a proxy?

Thank-you

Dan Sanville

foreman-installer is in fact unsetting any proxy_* environment variables, mostly because this used to be a major cause of all kinds of other problems during installations/upgrades.
Setting the proxy for internet based repos in /etc/dnf/dnf.conf (or on a per-repo base in the repo files) is the intended/supported way of doing things.
Though, looking at your error messages, I would assume div10_isd_cyber_repo_isd_cyber_repo might be a repo you are hosting somewhere locally? At least googleing for that only shows this exact post as a result. If so, I guess your proxy does not do “back to internal” connections and so dnf can not reach the internal repositories.
If my assumption is correct, you can either remove the proxy from the global dnf config and only add it for repos that are actually on the internet or disable the local repositories during Foreman installation if they only contain extra packages and there are no OS repos.