2011-03-15 20:06:18 +00:00
|
|
|
cdist-type__directory(7)
|
|
|
|
========================
|
2016-06-23 14:08:59 +00:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
cdist-type__directory - Manage a directory
|
2011-03-15 15:41:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2011-07-21 21:06:13 +00:00
|
|
|
This cdist type allows you to create or remove directories on the target.
|
2011-03-15 15:41:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
REQUIRED PARAMETERS
|
|
|
|
-------------------
|
2011-03-15 20:06:18 +00:00
|
|
|
None.
|
2011-03-15 15:41:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
OPTIONAL PARAMETERS
|
|
|
|
-------------------
|
2016-05-20 06:50:56 +00:00
|
|
|
state
|
2020-01-15 18:00:30 +00:00
|
|
|
'present', 'absent', 'exists' or 'pre-exists', defaults to 'present' where:
|
|
|
|
|
|
|
|
present
|
|
|
|
the directory exists and the given attributes are set.
|
|
|
|
absent
|
|
|
|
the directory does not exist.
|
|
|
|
exists
|
|
|
|
the directory exists, but its attributes are not altered if it already
|
|
|
|
existed.
|
|
|
|
pre-exists
|
|
|
|
check that the directory exists and is indeed a directory, but do not
|
|
|
|
create or modify it.
|
2011-07-21 21:06:13 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
group
|
2011-03-15 15:41:04 +00:00
|
|
|
Group to chgrp to.
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
mode
|
2011-03-15 15:41:04 +00:00
|
|
|
Unix permissions, suitable for chmod.
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
owner
|
2011-03-15 15:41:04 +00:00
|
|
|
User to chown to.
|
|
|
|
|
2012-09-21 08:40:37 +00:00
|
|
|
|
2012-09-21 09:12:32 +00:00
|
|
|
BOOLEAN PARAMETERS
|
|
|
|
------------------
|
2016-05-20 06:50:56 +00:00
|
|
|
parents
|
2013-04-03 14:49:03 +00:00
|
|
|
Whether to create parents as well (mkdir -p behaviour).
|
|
|
|
Warning: all intermediate directory permissions default
|
2020-01-15 18:00:30 +00:00
|
|
|
to whatever mkdir -p does.
|
2013-04-03 14:49:03 +00:00
|
|
|
|
|
|
|
Usually this means root:root, 0700.
|
2011-03-15 15:41:04 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
recursive
|
2011-03-22 08:59:41 +00:00
|
|
|
If supplied the chgrp and chown call will run recursively.
|
|
|
|
This does *not* influence the behaviour of chmod.
|
2011-03-15 15:41:04 +00:00
|
|
|
|
2014-01-09 15:09:49 +00:00
|
|
|
MESSAGES
|
|
|
|
--------
|
2016-05-20 06:50:56 +00:00
|
|
|
chgrp <group>
|
2014-01-09 15:09:49 +00:00
|
|
|
Changed group membership
|
2016-05-20 06:50:56 +00:00
|
|
|
chown <owner>
|
2014-01-09 15:09:49 +00:00
|
|
|
Changed owner
|
2016-05-20 06:50:56 +00:00
|
|
|
chmod <mode>
|
2014-01-09 15:09:49 +00:00
|
|
|
Changed mode
|
2016-05-20 06:50:56 +00:00
|
|
|
create
|
2014-01-09 15:09:49 +00:00
|
|
|
Empty directory was created
|
2016-05-20 06:50:56 +00:00
|
|
|
remove
|
2014-01-09 15:09:49 +00:00
|
|
|
Directory exists, but state is absent, directory will be removed by generated code.
|
2016-05-20 06:50:56 +00:00
|
|
|
remove non directory
|
2016-05-05 07:58:35 +00:00
|
|
|
Something other than a directory with the same name exists and was removed prior to create.
|
2014-01-09 15:09:49 +00:00
|
|
|
|
2012-09-21 09:12:32 +00:00
|
|
|
|
2011-03-15 15:41:04 +00:00
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
.. code-block:: sh
|
2011-03-15 15:41:04 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# A silly example
|
|
|
|
__directory /tmp/foobar
|
2011-07-21 21:06:13 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Remove a directory
|
|
|
|
__directory /tmp/foobar --state absent
|
2011-03-21 08:44:14 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Ensure /etc exists correctly
|
|
|
|
__directory /etc --owner root --group root --mode 0755
|
2011-03-22 08:59:41 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Create nfs service directory, including parents
|
|
|
|
__directory /home/services/nfs --parents
|
2011-04-20 11:47:36 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Change permissions recursively
|
|
|
|
__directory /home/services --recursive --owner root --group root
|
2012-09-21 09:12:32 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Setup a temp directory
|
|
|
|
__directory /local --mode 1777
|
2012-09-21 09:12:32 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Take it all
|
|
|
|
__directory /home/services/kvm --recursive --parents \
|
|
|
|
--owner root --group root --mode 0755 --state present
|
2011-03-15 15:41:04 +00:00
|
|
|
|
|
|
|
|
2016-06-17 19:28:16 +00:00
|
|
|
AUTHORS
|
|
|
|
-------
|
|
|
|
Nico Schottelius <nico-cdist--@--schottelius.org>
|
2011-03-15 15:41:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
COPYING
|
|
|
|
-------
|
2016-08-10 16:15:54 +00:00
|
|
|
Copyright \(C) 2011 Nico Schottelius. You can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|