0
0
mirror of https://github.com/saltstack-formulas/users-formula.git synced 2024-11-28 02:57:55 +01:00

Merge pull request #205 from sevrob/master

added dir_mode logic for users.user_files
This commit is contained in:
Imran Iqbal 2019-08-01 07:29:14 +01:00 committed by GitHub
commit 83ffcb4bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -164,6 +164,8 @@ users:
# it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save # it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
# execution bit for example. # execution bit for example.
file_mode: keep file_mode: keep
# You can specify octal mode for directories as well. This won't work on Windows minions
#dir_mode: 775
sym_mode: 640 sym_mode: 640
exclude_pat: "*.gitignore" exclude_pat: "*.gitignore"

View File

@ -11,6 +11,7 @@ include:
{%- set user_home = salt['pillar.get'](('users:' ~ username ~ ':home'), current.get('home', '/home/' ~ username )) -%} {%- set user_home = salt['pillar.get'](('users:' ~ username ~ ':home'), current.get('home', '/home/' ~ username )) -%}
{%- set user_files_template = salt['pillar.get'](('users:' ~ username ~ ':user_files:template'), None) -%} {%- 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_file_mode = salt['pillar.get'](('users:' ~ username ~ ':user_files:file_mode'), False) -%}
{%- set user_files_dir_mode = salt['pillar.get'](('users:' ~ username ~ ':user_files:dir_mode'), False) -%}
{%- set user_files_sym_mode = salt['pillar.get'](('users:' ~ username ~ ':user_files:sym_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) -%} {%- set user_files_exclude_pat = salt['pillar.get'](('users:' ~ username ~ ':user_files:exclude_pat'), False) -%}
{%- if user_files.enabled -%} {%- if user_files.enabled -%}
@ -45,6 +46,9 @@ users_userfiles_{{ username }}_recursive:
{% if user_files_file_mode -%} {% if user_files_file_mode -%}
- file_mode: {{ user_files_file_mode }} - file_mode: {{ user_files_file_mode }}
{% endif -%} {% endif -%}
{% if user_files_dir_mode -%}
- dir_mode: {{ user_files_dir_mode }}
{% endif -%}
{% if user_files_sym_mode -%} {% if user_files_sym_mode -%}
- sym_mode: {{ user_files_sym_mode }} - sym_mode: {{ user_files_sym_mode }}
{% endif -%} {% endif -%}