{"id":39990829,"url":"https://github.com/edvgui/inmanta-module-files","last_synced_at":"2026-01-20T17:35:55.350Z","repository":{"id":222372994,"uuid":"720766066","full_name":"edvgui/inmanta-module-files","owner":"edvgui","description":"Simple module containing various types of resource to manage files","archived":false,"fork":false,"pushed_at":"2026-01-13T07:44:18.000Z","size":242,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T10:35:29.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edvgui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-19T14:38:57.000Z","updated_at":"2026-01-13T07:44:16.000Z","dependencies_parsed_at":"2024-04-27T23:26:09.353Z","dependency_job_id":"b36c61a4-33af-4c15-9a9a-94b9db678285","html_url":"https://github.com/edvgui/inmanta-module-files","commit_stats":null,"previous_names":["edvgui/inmanta-module-files"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/edvgui/inmanta-module-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvgui%2Finmanta-module-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvgui%2Finmanta-module-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvgui%2Finmanta-module-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvgui%2Finmanta-module-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edvgui","download_url":"https://codeload.github.com/edvgui/inmanta-module-files/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edvgui%2Finmanta-module-files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28554783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T23:48:35.235Z","status":"ssl_error","status_checked_at":"2026-01-18T23:47:49.178Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-19T00:38:54.621Z","updated_at":"2026-01-19T00:38:55.250Z","avatar_url":"https://github.com/edvgui.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inmanta-module-files\n\n[![pypi version](https://img.shields.io/pypi/v/inmanta-module-files.svg)](https://pypi.python.org/pypi/inmanta-module-files/)\n[![build status](https://img.shields.io/github/actions/workflow/status/edvgui/inmanta-module-files/continuous-integration.yml)](https://github.com/edvgui/inmanta-module-files/actions)\n\nThis package is an adapter that is meant to be used with the inmanta orchestrator: https://docs.inmanta.com\n\n## Features\n\nThis module allows to manage files, on a unix host.  It contains the following resources:\n1. `files::Directory`: to manage a directory, its existence, permissions and ownership.\n2. `files::TextFile`: to manage a simple text file, its existence, content, permissions and ownership.  This should not be used for big files, as the content of the file is embedded in the resource itself.\n3. `files::HostFile`: to manage hosts file entries (i.e. `/etc/hosts`), but allowing the file to be managed by other tools.  The resource makes sure to only modify the entries defined in its desired state and leave the rest untouched.\n4. `files::JsonFile` and `files::SharedJsonFile`: to manage json file entries.  Similarly to `files::HostFile`, only change in the file what is present in the desired state.  The file can then still be modified by other tools.\n5. `files::SystemdUnitFile`: an entity representing a unit file, which exposes it most useful properties directly in the model.  After being exported, this resource becomes nothing more than a text file.\n6. `files::Symlink`: to manage a symlink, its existence and ownership.\n\n## Example\n\nThe following example makes sure that the directory `/tmp/test/a` exists, and creates a text file in it.\n```\nimport mitogen\nimport files\n\nimport std\n\nhost = std::Host(\n    name=\"localhost\",\n    os=std::linux,\n    via=mitogen::Local(),\n)\n\ndir = files::Directory(\n    host=host,\n    path=\"/tmp/test/a\",\n    # The directory that is managed is /tmp/test/a, but the resource\n    # will also make sure that any of its parent directories exists as well\n    create_parents=true,\n)\n\nfile = files::TextFile(\n    host=host,\n    path=f\"{dir.path}/file.txt\",\n    content=\"test\",\n    # The file requires the directory to be created first\n    requires=[dir],\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedvgui%2Finmanta-module-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedvgui%2Finmanta-module-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedvgui%2Finmanta-module-files/lists"}