Add proxy variables if defined by environment

kojid will not be able to merge repos and mock will not be able to build
a chroot in an environment where proxy variables are used unless they
are defined in configuration files.

Signed-off-by: George T Kramer <george.t.kramer@intel.com>
This commit is contained in:
George T Kramer
2018-11-13 11:44:42 -08:00
parent d79ad7d8ca
commit bdee352232

View File

@@ -328,6 +328,18 @@ ca = $KOJI_PKI_DIR/koji_ca_cert.crt
serverca = $KOJI_PKI_DIR/koji_ca_cert.crt
EOF
if env | grep -q proxy; then
echo "yum_proxy = $https_proxy" >> /etc/kojid/kojid.conf
mkdir -p /etc/systemd/system/kojid.service.d
cat > /etc/systemd/system/kojid.service.d/00-proxy.conf <<- EOF
[Service]
Environment=http_proxy=$http_proxy
Environment=https_proxy=$https_proxy
Environment=no_proxy=$no_proxy
EOF
systemctl daemon-reload
fi
systemctl enable --now kojid