{"id":32129913,"url":"https://github.com/edgej/puppet-filepath","last_synced_at":"2025-10-21T01:42:00.292Z","repository":{"id":57664681,"uuid":"165349582","full_name":"EdgeJ/puppet-filepath","owner":"EdgeJ","description":"Custom Puppet type for managing directories recursively","archived":false,"fork":false,"pushed_at":"2023-03-04T01:54:27.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T07:23:06.997Z","etag":null,"topics":["puppet","puppet-forge","puppet-module","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EdgeJ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-12T05:16:28.000Z","updated_at":"2024-09-06T00:13:24.000Z","dependencies_parsed_at":"2022-09-11T06:07:10.826Z","dependency_job_id":null,"html_url":"https://github.com/EdgeJ/puppet-filepath","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/EdgeJ/puppet-filepath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeJ%2Fpuppet-filepath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeJ%2Fpuppet-filepath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeJ%2Fpuppet-filepath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeJ%2Fpuppet-filepath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EdgeJ","download_url":"https://codeload.github.com/EdgeJ/puppet-filepath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeJ%2Fpuppet-filepath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280189420,"owners_count":26287702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["puppet","puppet-forge","puppet-module","ruby"],"created_at":"2025-10-21T01:41:56.318Z","updated_at":"2025-10-21T01:42:00.284Z","avatar_url":"https://github.com/EdgeJ.png","language":"Ruby","readme":"\n# filepath\n\n[![Build Status](https://travis-ci.org/EdgeJ/puppet-filepath.svg?branch=master)](https://travis-ci.org/EdgeJ/puppet-filepath)\n![Latest Tag](https://img.shields.io/github/tag/edgej/puppet-filepath.svg)\n[![PDK Version](https://img.shields.io/puppetforge/pdk-version/edgej/filepath.svg)](https://puppet.com/docs/pdk)\n[![Puppet Forge](https://img.shields.io/puppetforge/v/vStone/percona.svg)](https://forge.puppet.com/edgej/filepath)\n\nPuppet type to create and manage recursive filepaths without resorting to\nneedless hackery.\n\n#### Table of Contents\n\n1. [Description](#description)\n2. [Setup - The basics of getting started with filepath](#setup)\n    * [Beginning with filepath](#beginning-with-filepath)\n3. [Usage - Configuration options and additional functionality](#usage)\n4. [Limitations - OS compatibility, etc.](#limitations)\n5. [Development - Guide for contributing to the module](#development)\n\n## Description\n\nThe Puppet filepath module adds the `filepath` resource that can be used\nto recursively create a directory tree. \n\nOne of the significant limitations to Puppet's `file` resource is that\nit does not create parent directories, so specifying a path where the\nparent directory doesn't yet exist on the filesystem will cause an error\nat execution time (while typically passing any spec tests).\n\nThe `filepath` resource eliminates the common need for hacks and workarounds\nto ensure that parent directories exist for a `file` resource to be created.\n\nFor example:\n\n```puppet\nexec { 'parent dir':\n   command =\u003e \"mkdir -p ${directory}\",\n   creates =\u003e $directory,\n}\n```\n\nLike the built-in `file` resource, `filepath` can manage the owner, group,\nand permissions of the directory. Using the `managedepth` parameter, you may\nspecify how many levels down to set ownership and permissions, starting from\nthe deepest directory.\n\nFor example, setting `/path/to/some/dir` with `managedepth =\u003e 2` will result\nin the creation of the directories `path` and `to` with the default user\n(root) and permissions and the directories `some` and `dir` being created with\nthe specified ownership and permissions.\n\nThe `filepath` resource does not manage the contents of the directory, it\nonly creates the directories, similar to running `mkdir -p` at the shell.\n\n## Setup\n\n### Beginning with filepath\n\nNo additional setup needed after installing the module. Via pluginsync, the\ntype will be available to all catalogs and nodes.\n\n## Usage\nA simple example:\n\n```puppet\nfilepath { '/path/to/nested/directory':\n  ensure      =\u003e present,\n  owner       =\u003e 'foo',\n  group       =\u003e 'bar',\n  mode        =\u003e '0774',\n  managedepth =\u003e 2,\n}\n```\n\nOr, with managing a file within the nested directory tree:\n\n```puppet\nfilepath { '/opt/puppetlabs/bin':\n  ensure      =\u003e present,\n  owner       =\u003e 'foo',\n  group       =\u003e 'bar',\n  mode        =\u003e '0774',\n  managedepth =\u003e 2,\n}\n\nfile { '/opt/puppetlabs/bin/moog':\n   ensure =\u003e present,\n   owner  =\u003e 'foo',\n   group  =\u003e 'bar',\n   mode   =\u003e '0770'.\n   source =\u003e 'puppet:///modules/role/moog',\n   require =\u003e Filepath['/opt/puppetlabs/bin'],\n}\n```\n\nTo remove a filepath, specify the path to be removed and use `managedepth` to\ncontrol how many levels of the directory tree are removed.\n\n```sh\n$ ls /path/to/\ndeleted\n\n$ ls /path/to/deleted\ndir\n```\n\n```puppet\nfilepath { '/path/to/deleted/dir':\n  ensure =\u003e absent,\n  managedepth =\u003e 2,\n}\n```\n\n```sh\n$ ls /path/to\n\n$ ls /path/to/deleted\nls: /path/to/deleted: No such file or directory\n```\n\nAnd that's it! Very simple and without resorting to hacks to get the job done.\n\n## Limitations\n\nCurrently no support for non-posix operatingsystems (that means you, Windows!)\n\nThe `filepath` resource does not manage files or contents of any directories,\nonly creation or deletion of the path itself. Use the built-in `file` resource\nto set or remove any file or directory content.\n\n\nTested on Centos 7, Ubuntu 18.04, and Ubuntu 20.04.\n\n## Development\n\nThe module is largely developed with the Puppet Development Kit (pdk) and can\nbe validated and tested with that tool. The exception is Beaker tests, which\nrequire installation with Bundler for the gems and execution via `rake beaker`.\n\nTo submit a change to the module:\n\n* Fork the repo.\n* Make any necessary changes and validate syntax with `pdk validate`.\n* Add any unit tests for any additional features.\n* If applicable, add additional acceptance tests.\n* Ensure all tests are passing with `pdk test unit` or `rake spec`.\n* Submit a PR.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgej%2Fpuppet-filepath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgej%2Fpuppet-filepath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgej%2Fpuppet-filepath/lists"}