瀏覽代碼

Create home parent dir if makedirs is True

So that the state won't fail if the parent directory of the home
directory does not exist.
pull/165/head
Bruno Binet 6 年之前
父節點
當前提交
3a906fb0d2
共有 1 個檔案被更改,包括 9 行新增0 行删除
  1. +9
    -0
      linux/system/user.sls

+ 9
- 0
linux/system/user.sls 查看文件

@@ -23,6 +23,15 @@ system_group_{{ name }}:
- user: system_user_{{ name }}
{%- endif %}

{%- if user.get('makedirs') %}
system_user_home_parentdir_{{ user.home }}:
file.directory:
- name: {{ user.home | path_join("..") }}
- makedirs: true
- require_in:
- user: system_user_{{ name }}
{%- endif %}

system_user_{{ name }}:
user.present:
- name: {{ name }}

Loading…
取消
儲存