From 2763338abe4b3dc443734ce2cde06e600b557e09 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 9 Nov 2015 02:31:45 +0300 Subject: [PATCH 1/2] Update user_files.sls Fix for: Rendering SLS 'base:users.user_files' failed: Jinja variable 'dict object' has no attribute 'home' --- users/user_files.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/user_files.sls b/users/user_files.sls index 66363ae..bd99430 100644 --- a/users/user_files.sls +++ b/users/user_files.sls @@ -28,7 +28,7 @@ include: {%- if not skip_user %} users_userfiles_{{ username }}_recursive: file.recurse: - - name: {{ user.home }} + - name: {{ salt['pillar.get']( username ~ 'user:home', '/home/' ~ username )}} - source: {{ file_source }} - user: {{ username }} - group: {{ user_group }} From c05d2e635b40463325d3fbf44c048d98eedc08ca Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 12 Nov 2015 20:53:07 +0300 Subject: [PATCH 2/2] Update user_files.sls Default path for home folder in user_files.sls if home omitted in pillar. --- users/user_files.sls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/user_files.sls b/users/user_files.sls index bd99430..95c1281 100644 --- a/users/user_files.sls +++ b/users/user_files.sls @@ -7,6 +7,7 @@ include: {%- for username, user in salt['pillar.get']('users', {}).items() if (user.absent is not defined or not user.absent) -%} {%- set user_files = salt['pillar.get'](('users:' ~ username ~ ':user_files'), {'enabled': False}) -%} {%- set user_group = salt['pillar.get'](('users:' ~ username ~ ':prime_group:name'), username) -%} +{%- set user_home = salt['pillar.get'](('users:' ~ username ~ ':home'), '/home/' ~ username ) -%} {%- if user_files.enabled -%} {%- if user_files.source is defined -%} @@ -28,7 +29,7 @@ include: {%- if not skip_user %} users_userfiles_{{ username }}_recursive: file.recurse: - - name: {{ salt['pillar.get']( username ~ 'user:home', '/home/' ~ username )}} + - name: {{ user_home }} - source: {{ file_source }} - user: {{ username }} - group: {{ user_group }}