Chapter 13. Changing proxy settings RHUI can use a proxy server to sync Red Hat content through. If no proxy server is specified while installing RHUI, none is used. Otherwise, this proxy server is used with all RHUI repositories that you add. This chapter describes how the proxy server configuration can be changed. 13.1. Configuring a new proxy server or unconfiguring an existing proxy server Follow these steps if you wish to: start using a proxy server in a RHUI environment that was installed with no proxy server configuration edit the current proxy server configuration, for example, if the server hostname has changed stop using the proxy server that a RHUI environment was installed with Procedure There are two ways to configure (or unconfigure) proxy server settings. First option: Rerun the installer to update the global RHUI tools configuration and answers file: Second option: Create (or edit) the local overrides file, /root/.rhui/rhui-tools-custom.conf , so that it contains: Note This option was introduced in RHUI 4.11. In either case, the parameters are as follows: PROTOCOL is either http or https if configuring the proxy server; if unconfiguring it: if rerunning the installer, do not use the --proxy-protocol argument if using the local file, leave the value empty HOSTNAME is the new proxy server hostname; if clearing the configuration: if rerunning the installer, use an empty string in double quotes ( "" ) if using the local file, leave the value empty PORT is the TCP port where the proxy server is listening, typically 3128 ; if clearing the configuration: if rerunning the installer, do not use the --proxy-port argument if using the local file, leave the value empty USERNAME is an optional parameter. Only use it if the proxy server requires credentials. If it does not or you are clearing the configuration: if rerunning the installer, use "" if using the local file, leave the value empty or do not use the proxy_user: option at all PASSWORD ditto. Examples: Start using a proxy server, and this server requires no credentials. With the installer: With the local file: Change the proxy server hostname, everything else remains the same. With the installer: With the local file: Stop using the proxy server. With the installer: With the local file: Important This new configuration will only affect Red Hat repositories added after the configuration is updated. To apply this new configuration to existing repositories, it is necessary to remove, add, and re-synchronize the repositories. This will cause an outage that will last from the moment you remove them until you re-sync them. However, already synchronized packages will not have to be re-downloaded from the Red Hat CDN. RHUI will mainly have to parse all the repodata files and determine which package belongs where. This can take up to several hours. Although there are technical means outside of rhui-manager whereby the proxy fields can be modified for the existing repositories-or rather, for the so-called remotes -using such means is unsupported. Make sure you have a list (or lists) of your repositories so that you can add them again. If you do not have such a list, you can use rhui-manager to generate a file with all your currently added Red Hat repositories. To generate a list of Red Hat repositories, first create a raw list with one ID per line: Then create a YAML file with repositories. Start by creating a stub: , append the repositories from the raw list as YAML list items: Delete all Red Hat repositories from your RHUI: Use the text user interface, or delete them one by one on the command line. For the latter, you can use the raw list created earlier: Note Repositories are deleted in asynchronous background tasks: queued and executed by available Pulp workers. It may take tens of minutes, or hours, to actually delete all the repositories. Be patient. When the repositories have been deleted, re-add them. They will be added with the new proxy settings (or with no proxy URL) this time. It is also necessary to re-synchronize the repositories. You can add and re-synchronize them in one step on the command line: Alternatively, use your own methods to synchronize the repositories, for example, in a specific order. Lastly, you can also simply wait for the synchronization to start automatically: in six hours, or in any other time defined as repo_sync_frequency in /etc/rhui/rhui-tools.conf . Important In any case, the repositories will not be available in the meantime. Verification The rhui-manager tool does not display information about the proxy server that is used with a repository. However, you can use the pulpcore-manager tool as outlined below: The printed proxy URL is None if no proxy server is configured with the specified repository. Note Press CTRL+D to exit the pulpcore-manager shell.

Commands:
rhui-installer --rerun --proxy-protocol <PROTOCOL> --proxy-hostname <HOSTNAME> --proxy-port <PORT> --proxy-username <USERNAME> --proxy-password <PASSWORD>
[proxy] proxy_protocol: <PROTOCOL> proxy_host: <HOSTNAME> proxy_port: <PORT> proxy_user: <USERNAME> proxy_pass: <PASSWORD>
rhui-installer --rerun --proxy-protocol http --proxy-hostname squid.example.com --proxy-port 3128
[proxy] proxy_host: squid.example.com proxy_protocol: http proxy_port: 3128
rhui-installer --rerun --proxy-hostname newsquid.example.com
[proxy] proxy_host: newsquid.example.com
rhui-installer --rerun --proxy-hostname ""
[proxy] proxy_protocol: proxy_host: proxy_port:
rhui-manager --noninteractive repo list --redhat_only --ids_only > /root/rawlist
echo -e "name: all Red Hat repositories\nrepo_ids:" > /root/repo_list.yml
sed "s/^/ - /" /root/rawlist >> /root/repo_list.yml
while read repo; do rhui-manager --noninteractive repo delete --repo_id USDrepo; done < /root/rawlist
rhui-manager --noninteractive repo add_by_file --file /root/repo_list.yml --sync_now
env PULP_SETTINGS=/etc/pulp/settings.py /usr/bin/pulpcore-manager shell Python 3.11.11 (main, Dec 9 2024, 15:32:27) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from pulpcore.app.models import Remote >>> rem = Remote.objects.get(name="rhel-8-for-x86_64-baseos-rhui-rpms-8") >>> print(rem.proxy_url) http://squid.example.com:3128