CDIST-TYPE__DIRECTORY(7)

✨ NAME ✨

cdist-type__directory(7) β€” manage a directory πŸ’…

This is the cdist type that handles directories on the target, bestie. It can create them or remove them.


🌸 DESCRIPTION 🌸

This cdist type allows you to create or remove directories on the target. That's the whole vibe. ✨


πŸŽ€ REQUIRED PARAMETERS πŸŽ€

None. Not a single one, bestie β€” you're free to go off with the optional stuff. πŸ’–


πŸ’– OPTIONAL PARAMETERS πŸ’–

  • state β€” can be 'present', 'absent', 'exists' or 'pre-exists', and it 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. πŸ‘‘
  • group β€” Group to chgrp to. 🫢
  • mode β€” Unix permissions, suitable for chmod. πŸ’…
  • owner β€” User to chown to. πŸ‘‘

πŸ”₯ 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. πŸ’…

πŸ¦‹ 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 β€” Something other than a directory with the same name exists and was removed prior to create. 😭

🌈 EXAMPLES 🌈

Okay bestie, here are the examples, copied exactly so you can steal them:

# 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

πŸ’œ AUTHORS πŸ’œ

Nico Schottelius <nico-cdist--@--schottelius.org> 🌸


πŸ“œ COPYING πŸ“œ

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. πŸ’–


ungleich GmbH 2021 ✨


Catch you later, bestie β€” this was cdist-type__directory(7), from cdist version 7.0.0, dated Jul 31, 2022. Stay slay, stay organized, and may your directories always be exactly where you left them. πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from