Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cans/systemd-unit-install
Ansible role to install systemd units
https://github.com/cans/systemd-unit-install
Last synced: 9 days ago
JSON representation
Ansible role to install systemd units
- Host: GitHub
- URL: https://github.com/cans/systemd-unit-install
- Owner: cans
- License: gpl-2.0
- Created: 2017-08-07T23:38:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-23T01:06:08.000Z (almost 7 years ago)
- Last Synced: 2024-11-14T20:18:29.501Z (2 months ago)
- Language: Shell
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.rst
- License: LICENSE
Awesome Lists containing this project
README
systemd-install-unit
====================Install and setup systemd units.
This role expects each unit to be describe by an item following the schema below:
```yaml
- directory: "/some/other/path" # The directory in which install the unit (default: `systemd_unit_install_dir`)
remote: true # Whether the path in `unit` related to the local or the remote machine host (default: False)
unit: "/path/to/unit.service" # The path to the unit file (_with_ the `.service`, `.timer, ...).
user: true # Whether to install/run the service as a per-user (not system-wide) service.
state: "started" # Whether the unit should set to start on next boot, immediately or never.
# Admissible values: "disabled" (don't start), "enabled" (start on next boot) or "started" (start immediately)
tasks: # List of strings; Used to instanciate systemd templates (default is `[]`)
- "first"
- "second"
```Note that the units will be install, via Ansible's [template]()
Requirements
------------This role only applies to system running systemd, obviously. That means
Linux system, only distros who adopted it: Debian (and derivatives),
RedHat (and derivatives), ...Role Variables
--------------- `systemd_unit_install_dir`: the directory in which install units;
- `systemd_unit_install_units`: the list of units to install described as explained above;
- `systemd_unit_install_state`: the default state to set units in (default: 'enabled')
- `systemd_unit_install_remote`: whether unit file are to be taken from the local or the remote host (default: False).
- `systemd_unit_install_user`: whether units are to be installed system-wide (False) or as per-user services (True) by default (default: False).Dependencies
------------This role has no dependency.
Example Playbook
----------------```yaml
- hosts: servers
roles:
# install a bunch of units from files on the remote machine
- role: cans.systemd-install-unit
systemd_unit_install_remote: True# install a bunch of units from local files
- role: cans.systemd-install-unit
systemd_unit_install_units:
- unit: units/wonderful.service
directory: /usr/local/etc/systemd/system
- unit: units/critical.service
state: "started"
```License
-------GPLv2
Author Information
------------------Copyright © 2017-2018, Nicolas CANIART.