forked from hitachienergy/epiphany
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for hosts without yum-utils package hitachienergy#536
- Loading branch information
Showing
6 changed files
with
33 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
- sysstat | ||
- python-setuptools | ||
- openssl | ||
- yum-utils | ||
- yum-versionlock | ||
- logrotate | ||
- ebtables | ||
|
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 |
---|---|---|
|
@@ -15,6 +15,5 @@ enabled=1 | |
gpgcheck=0 | ||
EOF | ||
|
||
yum-config-manager --enable epirepo | ||
yum makecache fast | ||
yum repolist |
17 changes: 12 additions & 5 deletions
17
...ata/common/ansible/playbooks/roles/repository/files/client/RedHat/disable-system-repos.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 |
---|---|---|
@@ -1,9 +1,16 @@ | ||
#!/bin/bash -eu | ||
|
||
REPOS_LIST_FILE=/var/tmp/enabled-system-repos.txt | ||
YUM_REPOS_BACKUP_FILE=/etc/yum.repos.d/yum.repos.d-epi-backup.tar | ||
|
||
cat $REPOS_LIST_FILE | while read repository | ||
do | ||
echo "Disabling repository: $repository" | ||
yum-config-manager --disable $repository | ||
done | ||
if yum-config-manager --version > /dev/null 2>&1; then | ||
cat $REPOS_LIST_FILE | while read repository | ||
do | ||
echo "Disabling repository: $repository" | ||
yum-config-manager --disable $repository | ||
done | ||
elif [ ! -f $YUM_REPOS_BACKUP_FILE ]; then # for hosts where yum-utils is not available | ||
echo "Disabling all yum repositories by backup & remove files in /etc/yum.repos.d" | ||
tar -cv --verify --directory="/" --file=$YUM_REPOS_BACKUP_FILE /etc/yum.repos.d && | ||
rm -f /etc/yum.repos.d/*.repo | ||
fi |
23 changes: 18 additions & 5 deletions
23
...data/common/ansible/playbooks/roles/repository/files/client/RedHat/enable-system-repos.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 |
---|---|---|
@@ -1,9 +1,22 @@ | ||
#!/bin/bash -eu | ||
|
||
REPOS_LIST_FILE=/var/tmp/enabled-system-repos.txt | ||
YUM_REPOS_BACKUP_FILE=/etc/yum.repos.d/yum.repos.d-epi-backup.tar | ||
|
||
cat $REPOS_LIST_FILE | while read repository | ||
do | ||
echo "Enabling repository: $repository" | ||
yum-config-manager --enable $repository | ||
done | ||
if [ -f $YUM_REPOS_BACKUP_FILE ]; then # hosts without yum-config-manager | ||
echo "Restoring /etc/yum.repos.d/*.repo from: $YUM_REPOS_BACKUP_FILE" | ||
if tar -xv --file $YUM_CONFIG_BACKUP_FILE_PATH --directory /etc/yum.repos.d \ | ||
--strip-components=2 etc/yum.repos.d/*.repo; then | ||
echo "yum repositories restored" | ||
rm -f $YUM_REPOS_BACKUP_FILE | ||
else | ||
echo "Extracting tar failed: $YUM_REPOS_BACKUP_FILE" | ||
exit 2 | ||
fi | ||
else # hosts with yum-config-manager | ||
cat $REPOS_LIST_FILE | while read repository | ||
do | ||
echo "Enabling repository: $repository" | ||
yum-config-manager --enable $repository | ||
done | ||
fi |
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