aboutsummaryrefslogtreecommitdiff
path: root/kolla/template
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2020-01-02 09:56:10 +0100
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2020-01-02 09:58:58 +0100
commit2c2951b59b6e91c8f0ea6a82c1b3a9b16e1c02f7 (patch)
tree65792c94c4cb996657aa60590b8066dc9703607a /kolla/template
parent90babe35d0e075ad15904bb2263e1dd019f10532 (diff)
downloadkolla-2c2951b59b6e91c8f0ea6a82c1b3a9b16e1c02f7.tar.gz
kolla-2c2951b59b6e91c8f0ea6a82c1b3a9b16e1c02f7.zip
centos: disable EPEL by default
Our images use 'scsi-target-utils' from EPEL and then can be built without it. So let's disable this repository right after installing package from it. Images can enable EPEL with 'enable_extra_repos' macro. Also added 'disable_extra_repos' macro as we have some images in a need. Change-Id: Id70474e7602b531b63fdc11ae690fd9ed33def74
Diffstat (limited to 'kolla/template')
-rw-r--r--kolla/template/methods.py17
-rw-r--r--kolla/template/repos.yaml9
2 files changed, 22 insertions, 4 deletions
diff --git a/kolla/template/methods.py b/kolla/template/methods.py
index c4c34125d..73e9d515a 100644
--- a/kolla/template/methods.py
+++ b/kolla/template/methods.py
@@ -72,7 +72,7 @@ def debian_package_install(packages, clean_package_cache=True):
@contextfunction
-def enable_repos(context, reponames):
+def handle_repos(context, reponames, mode):
"""NOTE(hrw): we need to handle CentOS, Debian and Ubuntu with one macro.
Repo names have to be simple names mapped to proper ones. So 'ceph' ==
@@ -80,6 +80,14 @@ def enable_repos(context, reponames):
something else for Debian.
Distro/arch are not required to have all entries - we ignore missing ones.
"""
+
+ if mode == 'enable':
+ rpm_switch = '--enable'
+ elif mode == 'disable':
+ rpm_switch = '--disable'
+ else:
+ raise KeyError
+
repofile = os.path.dirname(os.path.realpath(__file__)) + '/repos.yaml'
with open(repofile, 'r') as repos_file:
repo_data = {}
@@ -102,10 +110,11 @@ def enable_repos(context, reponames):
for repo in reponames:
try:
if base_package_type == 'rpm':
- commands += ' --enable %s' % repo_list[repo]
+ commands += ' %s %s' % (rpm_switch, repo_list[repo])
elif base_package_type == 'deb':
- commands += 'echo "%s" ' % repo_list[repo]
- commands += '>/etc/apt/sources.list.d/%s.list && ' % repo
+ if mode == 'enable':
+ commands += 'echo "%s" ' % repo_list[repo]
+ commands += '>/etc/apt/sources.list.d/%s.list && ' % repo
except KeyError:
# NOTE(hrw): we ignore missing repositories for a given
# distro/arch
diff --git a/kolla/template/repos.yaml b/kolla/template/repos.yaml
index 90b1bbd2b..c0e6cdfca 100644
--- a/kolla/template/repos.yaml
+++ b/kolla/template/repos.yaml
@@ -2,27 +2,36 @@
centos:
ceph: "centos-ceph-nautilus"
elasticsearch: "elasticsearch-kibana-logstash-5.x"
+ epel: "epel"
+ extras: "extras"
grafana: "grafana"
hacluster: "network_ha-clustering_Stable"
influxdb: "influxdb"
kibana: "elasticsearch-kibana-logstash-5.x"
nfs-ganesha: "centos-nfs-ganesha28"
opendaylight: "opendaylight"
+ opstools: "centos-release-opstools"
rabbitmq: "rabbitmq_rabbitmq-server"
td-agent: "treasuredata"
centos-aarch64:
ceph: "centos-ceph-nautilus"
elasticsearch: "elasticsearch-kibana-logstash-5.x"
+ epel: "epel"
+ extras: "extras"
grafana: "grafana"
nfs-ganesha: "centos-nfs-ganesha28"
opendaylight: "opendaylight"
+ opstools: "centos-release-opstools"
rabbitmq: "rabbitmq_rabbitmq-server"
centos-ppc64le:
ceph: "centos-ceph-nautilus"
elasticsearch: "elasticsearch-kibana-logstash-5.x"
+ epel: "epel"
+ extras: "extras"
nfs-ganesha: "centos-nfs-ganesha28"
+ opstools: "centos-release-opstools"
rabbitmq: "rabbitmq_rabbitmq-server"
# NOTE(hrw): empty dict to avoid TypeError