{% macro install_packages(packages) -%}
{% if packages is defined and packages|length > 0 -%}
    {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] -%}
        RUN yum -y install {{ packages | join(' ') }} && yum clean all
    {%- elif base_distro in ['ubuntu', 'debian'] -%}
        {#-
          debian_package_install is a utility method to build up an appropriate
          set of commands to install packages in a debian-based environment that
          may include URL links to a .deb package (e.g, heka)
        -#}
        RUN {{ debian_package_install(packages) }}
    {%- endif %}
{%- endif %}
{%- endmacro %}