From ae1322ec10861678abe1137f3013030b34335bc7 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 15 Jan 2019 16:58:25 -0700 Subject: Use base_package_type This change updates the docker files to use base_package_type instead of doing specific distro checks for the rhel/deb generic cases. The base_distro is still available and is used when a specific distro needs a customization but if the differences are purely rpm vs deb, then the base_package_type can be used. Change-Id: I8d720bb185df65a0178061ccf20b1ab2265da2c5 --- docker/aodh/aodh-api/Dockerfile.j2 | 4 ++-- docker/aodh/aodh-base/Dockerfile.j2 | 8 ++++---- docker/aodh/aodh-evaluator/Dockerfile.j2 | 4 ++-- docker/aodh/aodh-expirer/Dockerfile.j2 | 4 ++-- docker/aodh/aodh-listener/Dockerfile.j2 | 4 ++-- docker/aodh/aodh-notifier/Dockerfile.j2 | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'docker/aodh') diff --git a/docker/aodh/aodh-api/Dockerfile.j2 b/docker/aodh/aodh-api/Dockerfile.j2 index b85483fda..abee6811e 100644 --- a/docker/aodh/aodh-api/Dockerfile.j2 +++ b/docker/aodh/aodh-api/Dockerfile.j2 @@ -6,9 +6,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_api_packages = ['openstack-aodh-api'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_api_packages = ['aodh-api'] %} {% endif %} {{ macros.install_packages(aodh_api_packages | customizable("packages")) }} diff --git a/docker/aodh/aodh-base/Dockerfile.j2 b/docker/aodh/aodh-base/Dockerfile.j2 index 9ef1b1160..83d3d7ccf 100644 --- a/docker/aodh/aodh-base/Dockerfile.j2 +++ b/docker/aodh/aodh-base/Dockerfile.j2 @@ -8,7 +8,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {{ macros.configure_user(name='aodh') }} {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_base_packages = [ 'httpd', @@ -23,7 +23,7 @@ RUN mkdir -p /var/www/cgi-bin/aodh \ && cp -a /usr/lib/python2.7/site-packages/aodh/api/app.wsgi /var/www/cgi-bin/aodh/ \ && sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_base_packages = [ 'aodh-common', @@ -40,7 +40,7 @@ RUN mkdir -p /var/www/cgi-bin/aodh \ {% endif %} {% elif install_type == 'source' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_base_packages = [ 'httpd', @@ -53,7 +53,7 @@ RUN mkdir -p /var/www/cgi-bin/aodh \ RUN mkdir -p /var/www/cgi-bin/aodh \ && sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_base_packages = [ 'apache2', diff --git a/docker/aodh/aodh-evaluator/Dockerfile.j2 b/docker/aodh/aodh-evaluator/Dockerfile.j2 index 5b6d13086..3e06be46a 100644 --- a/docker/aodh/aodh-evaluator/Dockerfile.j2 +++ b/docker/aodh/aodh-evaluator/Dockerfile.j2 @@ -6,9 +6,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_evaluator_packages = ['openstack-aodh-evaluator'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_evaluator_packages = ['aodh-evaluator'] %} {% endif %} {{ macros.install_packages(aodh_evaluator_packages | customizable("packages")) }} diff --git a/docker/aodh/aodh-expirer/Dockerfile.j2 b/docker/aodh/aodh-expirer/Dockerfile.j2 index 1ba8d93b6..6b1d8400d 100644 --- a/docker/aodh/aodh-expirer/Dockerfile.j2 +++ b/docker/aodh/aodh-expirer/Dockerfile.j2 @@ -6,9 +6,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_expirer_packages = ['openstack-aodh-expirer'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_expirer_packages = ['aodh-expirer'] %} {% endif %} {{ macros.install_packages(aodh_expirer_packages | customizable("packages")) }} diff --git a/docker/aodh/aodh-listener/Dockerfile.j2 b/docker/aodh/aodh-listener/Dockerfile.j2 index 728fd97f4..fef7b81ce 100644 --- a/docker/aodh/aodh-listener/Dockerfile.j2 +++ b/docker/aodh/aodh-listener/Dockerfile.j2 @@ -6,9 +6,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_listener_packages = ['openstack-aodh-listener'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_listener_packages = ['aodh-listener'] %} {% endif %} {{ macros.install_packages(aodh_listener_packages | customizable("packages")) }} diff --git a/docker/aodh/aodh-notifier/Dockerfile.j2 b/docker/aodh/aodh-notifier/Dockerfile.j2 index 41a311e01..7ecdb64f5 100644 --- a/docker/aodh/aodh-notifier/Dockerfile.j2 +++ b/docker/aodh/aodh-notifier/Dockerfile.j2 @@ -6,9 +6,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} {% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% if base_package_type == 'rpm' %} {% set aodh_notifier_packages = ['openstack-aodh-notifier'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} + {% elif base_package_type == 'deb' %} {% set aodh_notifier_packages = ['aodh-notifier'] %} {% endif %} {{ macros.install_packages(aodh_notifier_packages | customizable("packages")) }} -- cgit v1.2.3