aboutsummaryrefslogtreecommitdiff
path: root/docker/macros.j2
diff options
context:
space:
mode:
authorAndriy Kurilin <andr.kurilin@gmail.com>2024-09-17 13:49:32 +0200
committerAndriy Kurilin <andr.kurilin@gmail.com>2025-02-18 09:41:17 +0100
commitcfa266a3a2fd2f29ba48ecb93018197af5510649 (patch)
tree364717d58c985a4db60cd87a2bbbdfb221bec757 /docker/macros.j2
parent2941ea2c7a89c1852a943aed820a45fd9c4e05b7 (diff)
downloadkolla-cfa266a3a2fd2f29ba48ecb93018197af5510649.tar.gz
kolla-cfa266a3a2fd2f29ba48ecb93018197af5510649.zip
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 '<project>-user' section. In addition, the documentation and CI are extended to cover ``--docker-dir`` option. Change-Id: I690d9f3829083f2493bf286a1c45764b9699219b
Diffstat (limited to 'docker/macros.j2')
-rw-r--r--docker/macros.j23
1 files changed, 3 insertions, 0 deletions
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 %}