-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eve: Set up the company proxy for cluster nodes
The proxy is used only for yum repositories.
- Loading branch information
1 parent
cb255f4
commit cef5b8c
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
eve/workers/openstack-terraform/terraform/scripts/proxy-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
PROXY_IP=${1:-} | ||
PROXY_PORT=${2:-3128} | ||
PROXY_URL=http://$PROXY_IP:$PROXY_PORT | ||
PROXY_CA_URL=https://eve.devsca.com/vault/v1/release_engineering_root_CA_prod/cert/ca | ||
PROXY_CA_PATH=/etc/pki/ca-trust/source/anchors/scality_internal_ca.crt | ||
|
||
|
||
if ! [[ $PROXY_IP ]]; then | ||
echo "No proxy IP provided, exiting" | ||
exit | ||
fi | ||
|
||
if ! [ -f /etc/redhat-release ]; then | ||
echo "The proxy script only handle RedHat family dists." | ||
exit 1 | ||
fi | ||
|
||
curl -skx "$PROXY_URL" -L "$PROXY_CA_URL" \ | ||
| sed -e 's/.*"certificate":"\(.*\)","revocation_time".*/\1/' \ | ||
-e 's/\\n/\n/g' \ | ||
> "$PROXY_CA_PATH" | ||
|
||
update-ca-trust force-enable | ||
update-ca-trust extract | ||
|
||
yum-config-manager --save --setopt proxy="$PROXY_URL" |