forked from ungleich-public/cdist
Merge branch '__dot_file-dirmode' into 'master'
Added optional dirmode parameter to set the mode of (optional) the directory. See merge request ungleich-public/cdist!966
This commit is contained in:
commit
3566901e1c
4 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,9 @@ user
|
||||||
OPTIONAL PARAMETERS
|
OPTIONAL PARAMETERS
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
dirmode
|
||||||
|
forwarded to :strong:`__directory` type as mode
|
||||||
|
|
||||||
mode
|
mode
|
||||||
forwarded to :strong:`__file` type
|
forwarded to :strong:`__file` type
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ set -eu
|
||||||
user="$(cat "${__object}/parameter/user")"
|
user="$(cat "${__object}/parameter/user")"
|
||||||
home="$(cat "${__object}/explorer/home")"
|
home="$(cat "${__object}/explorer/home")"
|
||||||
primary_group="$(cat "${__object}/explorer/primary_group")"
|
primary_group="$(cat "${__object}/explorer/primary_group")"
|
||||||
|
dirmode="$(cat "${__object}/parameter/dirmode")"
|
||||||
|
|
||||||
# Create parent directory. Type __directory has flag 'parents', but it
|
# Create parent directory. Type __directory has flag 'parents', but it
|
||||||
# will leave us with root-owned directory in user home, which is not
|
# will leave us with root-owned directory in user home, which is not
|
||||||
|
@ -36,6 +37,7 @@ export CDIST_ORDER_DEPENDENCY
|
||||||
for dir ; do
|
for dir ; do
|
||||||
__directory "${home}/${dir}" \
|
__directory "${home}/${dir}" \
|
||||||
--group "${primary_group}" \
|
--group "${primary_group}" \
|
||||||
|
--mode "${dirmode}" \
|
||||||
--owner "${user}"
|
--owner "${user}"
|
||||||
done
|
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
|
state
|
||||||
mode
|
mode
|
||||||
source
|
source
|
||||||
|
dirmode
|
||||||
|
|
Loading…
Reference in a new issue