{"id":20331007,"url":"https://github.com/cans/systemd-unit-install","last_synced_at":"2026-05-22T16:33:11.815Z","repository":{"id":139898386,"uuid":"99629871","full_name":"cans/systemd-unit-install","owner":"cans","description":"Ansible role to install systemd units","archived":false,"fork":false,"pushed_at":"2018-02-23T01:06:08.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T15:24:14.092Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cans.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.rst","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-08-07T23:38:41.000Z","updated_at":"2017-09-27T05:54:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ad290f0-bccd-4604-800a-79c230ba310a","html_url":"https://github.com/cans/systemd-unit-install","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fsystemd-unit-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fsystemd-unit-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fsystemd-unit-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fsystemd-unit-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cans","download_url":"https://codeload.github.com/cans/systemd-unit-install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241845818,"owners_count":20029941,"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","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":"2024-11-14T20:18:27.824Z","updated_at":"2026-05-22T16:33:06.790Z","avatar_url":"https://github.com/cans.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"systemd-install-unit\n====================\n\nInstall and setup systemd units.\n\n\nThis role expects each unit to be describe by an item following the schema below:\n\n```yaml\n- directory: \"/some/other/path\"    # The directory in which install the unit (default: `systemd_unit_install_dir`)\n  remote: true                     # Whether the path in `unit` related to the local or the remote machine host (default: False)\n  unit: \"/path/to/unit.service\"    # The path to the unit file (_with_ the `.service`, `.timer, ...).\n  user: true                       # Whether to install/run the service as a per-user (not system-wide) service.\n  state: \"started\"                 # Whether the unit should set to start on next boot, immediately or never.\n                                   # Admissible values: \"disabled\" (don't start), \"enabled\" (start on next boot) or \"started\" (start immediately)\n  tasks:                           # List of strings; Used to instanciate systemd templates (default is `[]`)\n    - \"first\"\n    - \"second\"\n```\n\nNote that the units will be install, via Ansible's [template]()\n\n\nRequirements\n------------\n\nThis role only applies to system running systemd, obviously. That means\nLinux system, only distros who adopted it: Debian (and derivatives),\nRedHat (and derivatives), ...\n\n\nRole Variables\n--------------\n\n- `systemd_unit_install_dir`: the directory in which install units;\n- `systemd_unit_install_units`: the list of units to install described as explained above;\n- `systemd_unit_install_state`: the default state to set units in (default: 'enabled')\n- `systemd_unit_install_remote`: whether unit file are to be taken from the local or the remote host (default: False).\n- `systemd_unit_install_user`: whether units are to be installed system-wide (False) or as per-user services (True) by default (default: False).\n\n\n\nDependencies\n------------\n\nThis role has no dependency.\n\n\nExample Playbook\n----------------\n\n\n```yaml\n- hosts: servers\n  roles:\n    # install a bunch of units from files on the remote machine\n    - role: cans.systemd-install-unit\n      systemd_unit_install_remote: True\n\n    # install a bunch of units from local files\n    - role: cans.systemd-install-unit\n      systemd_unit_install_units:\n        - unit: units/wonderful.service\n          directory: /usr/local/etc/systemd/system\n        - unit: units/critical.service\n          state: \"started\"\n```\n\n\nLicense\n-------\n\nGPLv2\n\n\nAuthor Information\n------------------\n\nCopyright © 2017-2018, Nicolas CANIART.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fsystemd-unit-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcans%2Fsystemd-unit-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fsystemd-unit-install/lists"}