From c062a34603a3ff35e805c51c93a74d762fca6358 Mon Sep 17 00:00:00 2001 From: Arthur Lutz Date: Thu, 21 Jun 2018 17:01:01 +0200 Subject: [PATCH 1/2] [users/users_files] add exclude_pat to user files (closes #178) --- pillar.example | 1 + users/user_files.sls | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/pillar.example b/pillar.example index df81335..9bcb9ea 100644 --- a/pillar.example +++ b/pillar.example @@ -135,6 +135,7 @@ users: # execution bit for example. file_mode: keep sym_mode: 640 + exclude_pat: "*.gitignore" ## Absent user cuser: diff --git a/users/user_files.sls b/users/user_files.sls index af81e96..5fd3fb2 100644 --- a/users/user_files.sls +++ b/users/user_files.sls @@ -12,6 +12,7 @@ include: {%- set user_files_template = salt['pillar.get'](('users:' ~ username ~ ':user_files:template'), None) -%} {%- set user_files_file_mode = salt['pillar.get'](('users:' ~ username ~ ':user_files:file_mode'), False) -%} {%- set user_files_sym_mode = salt['pillar.get'](('users:' ~ username ~ ':user_files:sym_mode'), False) -%} +{%- set user_files_exclude_pat = salt['pillar.get'](('users:' ~ username ~ ':user_files:exclude_pat'), False) -%} {%- if user_files.enabled -%} {%- if user_files.source is defined -%} @@ -47,6 +48,9 @@ users_userfiles_{{ username }}_recursive: {% if user_files_sym_mode -%} - sym_mode: {{ user_files_sym_mode }} {% endif -%} + {% if user_files_exclude_pat -%} + - exclude_pat: {{ user_files_exclude_pat }} + {% endif -%} - include_empty: True - keep_symlinks: True - require: From d528e16c5cee269a4f759c67140d02fe25a0bdd7 Mon Sep 17 00:00:00 2001 From: Arthur Lutz Date: Thu, 21 Jun 2018 18:22:24 +0200 Subject: [PATCH 2/2] [users/users_files] use quotes for exclude_pat --- 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 5fd3fb2..c66ca40 100644 --- a/users/user_files.sls +++ b/users/user_files.sls @@ -49,7 +49,7 @@ users_userfiles_{{ username }}_recursive: - sym_mode: {{ user_files_sym_mode }} {% endif -%} {% if user_files_exclude_pat -%} - - exclude_pat: {{ user_files_exclude_pat }} + - exclude_pat: "{{ user_files_exclude_pat }}" {% endif -%} - include_empty: True - keep_symlinks: True