https://github.com/cycloidio/ansible-systemd
Complement of https://github.com/tumf/ansible-role-systemd-service.git to provide features like mount and timer
https://github.com/cycloidio/ansible-systemd
Last synced: 3 months ago
JSON representation
Complement of https://github.com/tumf/ansible-role-systemd-service.git to provide features like mount and timer
- Host: GitHub
- URL: https://github.com/cycloidio/ansible-systemd
- Owner: cycloidio
- Created: 2017-10-03T13:17:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-17T08:52:31.000Z (over 6 years ago)
- Last Synced: 2025-02-28T17:54:38.420Z (over 1 year ago)
- Size: 8.79 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ansible-systemd
===============
Extend features of https://github.com/tumf/ansible-role-systemd-service.
Give a way to create timer, mount and droppin on systemd
Role Variables
--------------
**Dropin:**
| **Variable** | **Description** | **Default** |
|---------------------------|----------------------------|-----------------------------------------------------------------|
| `systemd_mount_dir` | Systemd mount dir | `/etc/systemd/system` |
| `systemd_dropin_dir` | Systemd dropin dir | `/etc/systemd/system/{{systemd_dropin_service_name}}.service.d` |
| `systemd_dropin_name` | Name of the dropin | `{{systemd_dropin_service_name}}` |
| `systemd_dropin_priority` | Dropin priority level | `40` |
| `systemd_dropin_content` | Content list of the dropin | `[]` |
**Timer:**
| **Variable** | **Description** | **Default** | **Required** |
|-----------------------------------|---------------------------------|-----------------------|--------------|
| `systemd_timer_service_name` | Name of the timer service | | **Yes** |
| `systemd_timer_onbootsec` | Define systemd OnBootSec | `5min` | |
| `systemd_timer_onunitactivesec` | Define systemd OnUnitActiveSec | `60min` | |
| `systemd_timer_dir` | Systemd directory for timers | `/etc/systemd/system` | |
| `systemd_timer_OnCalendar` | Systemd timer onCalendar | | |
| `systemd_timer_RemainAfterElapse` | Systemd timer RemainAfterElapse | | |
| `systemd_timer_service_enabled` | Timer enabled at boot | True | |
**Mount:** (https://www.freedesktop.org/software/systemd/man/systemd.mount.html)
| **Variable** | **Description** | **Default** | **Required** |
|----------------------------|-----------------------------|-------------|--------------|
| `systemd_mount_device` | Device to mount | | **Yes** |
| `systemd_mount_mountpoint` | Mountpoint of the device | | **Yes** |
| `systemd_mount_type` | Type of filesystem to mount | `ext4` | |
| `systemd_mount_options` | Option to pass to mount | `None` | |
Example Playbook
----------------
```
- hosts: servers
roles:
- role: cycloid.systemd
systemd_type: mount
systemd_mount_device: "{{etcd_volume_device}}"
systemd_mount_mountpoint: /var/lib/etcd2
- role: cycloid.systemd
systemd_type: dropin
systemd_dropin_service_name: "{{etcd_service}}"
systemd_dropin_name: persistent-storage
systemd_dropin_priority: "01"
systemd_dropin_content:
- "[Unit]"
- "After=var-lib-etcd2.mount"
- "Requires=var-lib-etcd2.mount"
- role: cycloid.systemd
systemd_type: timer
systemd_timer_service_name: etcd2-backup
systemd_timer_onbootsec: 5min
systemd_timer_onunitactivesec: "{{etcd_backup_timer_every}}"
```
License
-------
BSD
Author Information
------------------
Gael Lambert at Cycloid.io