drop *_existing_user_fix macros

Commit 109706aa8b bumped 'system' users
beyond range used by Kolla. So Debian/Ubuntu does not complain that
system users created by packages exist already on package install.

Change-Id: I9bf4b240839d46088ac668f26cf065dd5e3775c2
This commit is contained in:
Marcin Juszkiewicz 2019-11-29 17:20:14 +01:00
parent 0bc6348ea5
commit 70ef9a4fee
5 changed files with 0 additions and 49 deletions

View File

@ -7,10 +7,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='haproxy') }}
{% if base_package_type == 'deb' %}
{{ macros.debian_haproxy_existing_user_fix() }}
{% endif %}
{% set haproxy_packages = [
'haproxy'
] %}

View File

@ -72,33 +72,6 @@ RUN usermod --append --home {{ homedir }} --groups kolla {{ name }} \
&& chown -R {{ user.uid }}:{{ user.gid }} {{ homedir }}
{% endmacro %}
{% macro debian_fix_existing_user(package, lines) %}
RUN apt-get update \
&& apt-get -y install --no-install-recommends {{ package }} \
|| sed -i '/adduser/,+{{ lines }} d' /var/lib/dpkg/info/{{ package }}.postinst \
&& echo "configuring packages" \
&& dpkg --configure -a \
&& echo "done" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
{% endmacro %}
{% macro debian_haproxy_existing_user_fix() %}
{# NOTE(SamYaple): The postinst script breaks if the user 'haproxy' already exists #}
{{ debian_fix_existing_user('haproxy', 1) }}
{% endmacro %}
{% macro debian_mongodb_existing_user_fix() %}
{# NOTE(hrw): The postinst script breaks if the user 'mongodb' already exists #}
{# TODO(hrw): Version in Debian 'testing' checks does user exists #}
{{ debian_fix_existing_user('mongodb-server', 3) }}
{% endmacro %}
{% macro debian_opendaylight_existing_user_fix() %}
{# NOTE(egonzalez): The postinst script breaks if the user 'odl' already exists #}
{{ debian_fix_existing_user('opendaylight', 1) }}
{% endmacro %}
{% macro install_fluent_plugins(binary, plugins, chain=False) -%}
{% if plugins is defined and plugins|length > 0 -%}
{% if not chain -%} RUN {% endif -%}

View File

@ -18,11 +18,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
] %}
{% endif %}
{% if base_distro in ['debian'] %}
{# NOTE(hrw) Ubuntu does not need that #}
{{ macros.debian_mongodb_existing_user_fix() }}
{% endif %}
{{ macros.install_packages(mongodb_packages | customizable("packages")) }}
COPY mongodb_sudoers /etc/sudoers.d/kolla_mongodb_sudoers

View File

@ -7,10 +7,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='neutron') }}
{% if base_package_type == 'deb' %}
{{ macros.debian_haproxy_existing_user_fix() }}
{% endif %}
{% if install_type == 'binary' %}
{% if base_package_type == 'rpm' %}
@ -61,8 +57,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
# FIXED(jeffrey4l): UCA rocky release is not include python-vmware-nsx
# 13.0.0 package now. add 'python-vmware-nsx' into
# neutron_base_packages list after UCA fixed the issue.
{{ macros.debian_haproxy_existing_user_fix() }}
{% endif %}
{{ macros.install_packages(neutron_base_packages | customizable("packages")) }}

View File

@ -26,13 +26,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
'opendaylight',
'openjdk-' + java_version + '-jre-headless',
] %}
# NOTE(egonzalez): ODL fails to install in debian family images with
# existing odl user. First install odl and then allow usage of
# install_packages macro for custom configs.
{% block debian_opendaylight_install_fix_block %}
{{ macros.debian_opendaylight_existing_user_fix() }}
{% endblock %}
{% endif %}
{{ macros.install_packages(opendaylight_packages | customizable("packages")) }}