cdist-type__directory(7)


Table of Contents

1. NAME
2. DESCRIPTION
3. REQUIRED PARAMETERS
4. OPTIONAL PARAMETERS
5. BOOLEAN PARAMETERS
6. MESSAGES
7. EXAMPLES
8. SEE ALSO
9. COPYING

1. NAME

cdist-type__directory - Manage a directory

2. DESCRIPTION

This cdist type allows you to create or remove directories on the target.

3. REQUIRED PARAMETERS

None.

4. OPTIONAL PARAMETERS

state
present or absent, defaults to present
group
Group to chgrp to.
mode
Unix permissions, suitable for chmod.
owner
User to chown to.

5. BOOLEAN PARAMETERS

parents

Whether to create parents as well (mkdir -p behaviour). Warning: all intermediate directory permissions default to whatever mkdir -p does.

Usually this means root:root, 0700.
recursive
If supplied the chgrp and chown call will run recursively. This does not influence the behaviour of chmod.

6. MESSAGES

chgrp <group>
Changed group membership
chown <owner>
Changed owner
chmod <mode>
Changed mode
create
Empty directory was created
remove
Directory exists, but state is absent, directory will be removed by generated code.
remove non directory
Someting other than a directory with the same name exists and was removed prior to create.

7. EXAMPLES

# A silly example
__directory /tmp/foobar

# Remove a directory
__directory /tmp/foobar --state absent

# Ensure /etc exists correctly
__directory /etc --owner root --group root --mode 0755

# Create nfs service directory, including parents
__directory /home/services/nfs --parents

# Change permissions recursively
__directory /home/services --recursive --owner root --group root

# Setup a temp directory
__directory /local --mode 1777

# Take it all
__directory /home/services/kvm --recursive --parents \
    --owner root --group root --mode 0755 --state present

8. SEE ALSO

  • cdist-type(7)

9. COPYING

Copyright (C) 2011 Nico Schottelius. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3).