From cfa266a3a2fd2f29ba48ecb93018197af5510649 Mon Sep 17 00:00:00 2001 From: Andriy Kurilin Date: Tue, 17 Sep 2024 13:49:32 +0200 Subject: Allow to use configure_user macro for external templates Commit 79a234239516b94b1b79c7ddafcc4fbe4e3ba155 introduced an ability to build 'in-house'/'not-built-in' projects with Kolla. This commits extends this feature with an ability to use configure_user macro for 'not-built-in' users. The implementation is done the same way as for 'sources', i.e. engine after registers new section structure as soon as it finds unknown '-user' section. In addition, the documentation and CI are extended to cover ``--docker-dir`` option. Change-Id: I690d9f3829083f2493bf286a1c45764b9699219b --- docker/macros.j2 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docker') diff --git a/docker/macros.j2 b/docker/macros.j2 index 48c56208c..34d67335c 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -43,6 +43,9 @@ {% endmacro %} {% macro configure_user(name, groups=None, shell=None, homedir=None) %} +{%- if name not in users %} +{{ raise_error("Failed to find configuration for '" + name + "' user. Try specifying '" + name + "-user' config section.") }} +{%- endif %} {% set user=users[name] %} {%- if not homedir %} {% set homedir='/var/lib/' + name %} -- cgit v1.2.3