From 547db95d62ed98aae0adab6533846d2a115fa542 Mon Sep 17 00:00:00 2001 From: Ryan Billington Date: Thu, 14 Nov 2013 10:13:45 -0600 Subject: [PATCH] Fix Undefined jinja variable error with Salt 0.17.1 Ran into an error with Salt version 0.17.1: Rendering SLS users failed, render error: Undefined jinja variable; line 32 After finding https://github.com/saltstack/salt/issues/8245, and working on line 32, I surmised that line 28 might be the actual cause of the issue. I just added a quick check to see if uid exists in user, just as the user uid line does. --- users/init.sls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/init.sls b/users/init.sls index b264c99..a9619b4 100644 --- a/users/init.sls +++ b/users/init.sls @@ -25,7 +25,9 @@ include: - group: {{ name }} group.present: - name: {{ name }} + {% if 'uid' in user -%} - gid: {{ user['uid'] }} + {% endif %} user.present: - name: {{ name }} - home: {{ home }}