1CDIST-TYPE__DIRECTORY(7) cdist CDIST-TYPE__DIRECTORY(7)
2
3
4
6 cdist-type__directory - Manage a directory
7
9 This cdist type allows you to create or remove directories on the tar‐
10 get.
11
13 None.
14
16 state 'present', 'absent', 'exists' or 'pre-exists', defaults to
17 'present' where:
18
19 present
20 the directory exists and the given attributes are set.
21
22 absent the directory does not exist.
23
24 exists the directory exists, but its attributes are not altered
25 if it already existed.
26
27 pre-exists
28 check that the directory exists and is indeed a direc‐
29 tory, but do not create or modify it.
30
31 group Group to chgrp to.
32
33 mode Unix permissions, suitable for chmod.
34
35 owner User to chown to.
36
38 parents
39 Whether to create parents as well (mkdir -p behaviour). Warn‐
40 ing: all intermediate directory permissions default to whatever
41 mkdir -p does.
42
43 Usually this means root:root, 0700.
44
45 recursive
46 If supplied the chgrp and chown call will run recursively. This
47 does not influence the behaviour of chmod.
48
50 chgrp <group>
51 Changed group membership
52
53 chown <owner>
54 Changed owner
55
56 chmod <mode>
57 Changed mode
58
59 create Empty directory was created
60
61 remove Directory exists, but state is absent, directory will be removed
62 by generated code.
63
64 remove non directory
65 Something other than a directory with the same name exists and
66 was removed prior to create.
67
69 # A silly example
70 __directory /tmp/foobar
71
72 # Remove a directory
73 __directory /tmp/foobar --state absent
74
75 # Ensure /etc exists correctly
76 __directory /etc --owner root --group root --mode 0755
77
78 # Create nfs service directory, including parents
79 __directory /home/services/nfs --parents
80
81 # Change permissions recursively
82 __directory /home/services --recursive --owner root --group root
83
84 # Setup a temp directory
85 __directory /local --mode 1777
86
87 # Take it all
88 __directory /home/services/kvm --recursive --parents \
89 --owner root --group root --mode 0755 --state present
90
92 Nico Schottelius <nico-cdist--@--schottelius.org>
93
95 Copyright (C) 2011 Nico Schottelius. You can redistribute it and/or
96 modify it under the terms of the GNU General Public License as pub‐
97 lished by the Free Software Foundation, either version 3 of the Li‐
98 cense, or (at your option) any later version.
99
101 ungleich GmbH 2021
102
103
104
105
1067.0.0 Jul 31, 2022 CDIST-TYPE__DIRECTORY(7)