Added optional dirmode parameter to set the mode of (optional) the directory.
This commit is contained in:
parent
71f2283117
commit
8dc2c4207c
4 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,9 @@ user
|
|||
OPTIONAL PARAMETERS
|
||||
-------------------
|
||||
|
||||
dirmode
|
||||
forwarded to :strong:`__directory` type as mode
|
||||
|
||||
mode
|
||||
forwarded to :strong:`__file` type
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ set -eu
|
|||
user="$(cat "${__object}/parameter/user")"
|
||||
home="$(cat "${__object}/explorer/home")"
|
||||
primary_group="$(cat "${__object}/explorer/primary_group")"
|
||||
dirmode="$(cat "${__object}/parameter/dirmode")"
|
||||
|
||||
# Create parent directory. Type __directory has flag 'parents', but it
|
||||
# will leave us with root-owned directory in user home, which is not
|
||||
|
@ -36,6 +37,7 @@ export CDIST_ORDER_DEPENDENCY
|
|||
for dir ; do
|
||||
__directory "${home}/${dir}" \
|
||||
--group "${primary_group}" \
|
||||
--mode "${dirmode}" \
|
||||
--owner "${user}"
|
||||
done
|
||||
|
||||
|
|
1
cdist/conf/type/__dot_file/parameter/default/dirmode
Normal file
1
cdist/conf/type/__dot_file/parameter/default/dirmode
Normal file
|
@ -0,0 +1 @@
|
|||
0700
|
|
@ -1,3 +1,4 @@
|
|||
state
|
||||
mode
|
||||
source
|
||||
dirmode
|
||||
|
|
Loading…
Reference in a new issue