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.
This commit is contained in:
Ryan Billington 2013-11-14 10:13:45 -06:00
parent b41c70a6d1
commit 547db95d62

View File

@ -25,7 +25,9 @@ include:
- group: {{ name }} - group: {{ name }}
group.present: group.present:
- name: {{ name }} - name: {{ name }}
{% if 'uid' in user -%}
- gid: {{ user['uid'] }} - gid: {{ user['uid'] }}
{% endif %}
user.present: user.present:
- name: {{ name }} - name: {{ name }}
- home: {{ home }} - home: {{ home }}