Remove EPEL support

EPEL packages have not been required for Packstack since a couple
cycles. Moreover, they are known to cause conflicts with RDO-provided
packages, so it's better to remove support completely.

Change-Id: I659c84d5944e419744f8903cf64581d28bfc77f3
This commit is contained in:
Javier Pena 2017-05-10 12:11:33 +02:00
parent 378ec12102
commit f5716c9454
6 changed files with 6 additions and 87 deletions

View File

@ -52,10 +52,6 @@ Then edit `ans.txt` as appropriate e.g.
- Edit the IP address to anywhere you want to install a piece of OpenStack on another server
- Edit the 3 network interfaces to whatever makes sense in your setup
you'll need to use a icehouse repository for example for RHEL
$ CONFIG_REPO=http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/
$ packstack --answer-file=ans.txt
### Option 3 (prompts for configuration options)

View File

@ -184,9 +184,6 @@ Global unsupported options
Server Prepare Configs
-----------------------
**CONFIG_USE_EPEL**
Specify 'y' to enable the EPEL repository (Extra Packages for Enterprise Linux). ['y', 'n']
**CONFIG_REPO**
Comma-separated list of URLs for any additional yum repositories, to use for installation.

View File

@ -579,18 +579,6 @@ def initConfig(controller):
],
"SERVERPREPARE": [
{"CMD_OPTION": "use-epel",
"PROMPT": "To subscribe each server to EPEL enter \"y\"",
"OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options],
"DEFAULT_VALUE": "n",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_USE_EPEL",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "additional-repo",
"PROMPT": ("Enter a comma separated list of URLs to any "
"additional yum repositories to install"),
@ -1134,70 +1122,6 @@ def run_rhsm_reg(host, username, password, optional=False, proxy_server=None,
server.execute(mask_list=[password])
def manage_epel(host, config):
"""
Installs and/or enables EPEL repo if it is required or disables it if it
is not required.
"""
relevant = ('redhat', 'centos', 'scientific')
if detect_os_and_version(host)[0].lower() not in relevant:
return
# yum's $releasever can be non numeric on RHEL, so interpolate here
releasever = detect_os_and_version(host)[1].split('.')[0]
mirrors = ('https://mirrors.fedoraproject.org/metalink?repo=epel-%s&'
'arch=$basearch' % releasever)
server = utils.ScriptRunner(host)
if config['CONFIG_USE_EPEL'] == 'y':
server.append('REPOFILE=$(mktemp)')
server.append('cat /etc/yum.conf > $REPOFILE')
server.append("echo -e '[packstack-epel]\nname=packstack-epel\n"
"enabled=1\nmirrorlist=%(mirrors)s' >> $REPOFILE"
% locals())
server.append('( rpm -q --whatprovides epel-release ||'
' yum install -y --nogpg -c $REPOFILE epel-release ) '
'|| true')
server.append('rm -rf $REPOFILE')
try:
server.execute()
except exceptions.ScriptRuntimeError as ex:
msg = 'Failed to set EPEL repo on host %s:\n%s' % (host, ex)
raise exceptions.ScriptRuntimeError(msg)
# if there's an epel repo explicitly enables or disables it
# according to: CONFIG_USE_EPEL
if config['CONFIG_USE_EPEL'] == 'y':
cmd = 'enable'
enabled = '(1|True)'
else:
cmd = 'disable'
enabled = '(0|False)'
server.clear()
server.append('rpm -q yum-utils || yum -y install yum-utils')
server.append('yum-config-manager --%(cmd)s epel' % locals())
rc, out = server.execute()
# yum-config-manager returns 0 always, but returns current setup
# if succeeds
match = re.search('enabled\s*\=\s*%(enabled)s' % locals(), out)
if match:
return
msg = 'Failed to set EPEL repo on host %s:\n'
if cmd == 'enable':
# fail in case user wants to have EPEL enabled
msg += ('RPM file seems to be installed, but appropriate repo file is '
'probably missing in /etc/yum.repos.d/')
raise exceptions.ScriptRuntimeError(msg % host)
else:
# just warn in case disabling failed which might happen when EPEL repo
# is not installed at all
msg += 'This is OK in case you don\'t want EPEL installed and enabled.'
# TO-DO: fill logger name when logging will be refactored.
logger = logging.getLogger()
logger.warning(msg % host)
def manage_centos_release_openstack(host, config):
"""
Installs and enables CentOS OpenStack release package if installed locally.
@ -1456,8 +1380,6 @@ def server_prep(config, messages):
manage_centos_release_openstack(hostname, config)
# enable RDO if it is installed locally
manage_rdo(hostname, config)
# enable or disable EPEL according to configuration
manage_epel(hostname, config)
# Add yum repositories if configured
CONFIG_REPO = config["CONFIG_REPO"].strip()

View File

@ -0,0 +1,5 @@
---
deprecations:
- Support to enable the EPEL repository has been removed.
It is known to cause conflicts with packages provided
with RDO, and it is no longer needed.

View File

@ -102,7 +102,7 @@ class CommandLineTestCase(PackstackTestCaseMixin, TestCase):
sys.argv = ['packstack', '--debug',
'--ssh-public-key=%s' % dummy_public_key,
'--install-hosts=127.0.0.1', '--os-swift-install=y',
'--nagios-install=y', '--use-epel=y', '--ssl-cacert-selfsign=y',
'--nagios-install=y', '--ssl-cacert-selfsign=y',
'--ssl-cert-dir=%s' % os.path.expanduser('~/')]
# There is no puppet logfile to validate, so replace

View File

@ -32,7 +32,6 @@ class OSPluginUtilsTestCase(PackstackTestCaseMixin, TestCase):
password = "dasd|'asda%><?"
prescript_000.controller.CONF["CONFIG_KEYSTONE_HOST"] = "1.2.3.4"
prescript_000.controller.CONF["CONFIG_USE_EPEL"] = "n"
prescript_000.controller.CONF["CONFIG_REPO"] = ""
prescript_000.controller.CONF["CONFIG_RH_USER"] = "testuser"
prescript_000.controller.CONF["CONFIG_RH_PW"] = password