systemd
Collection: builtin
Full Name: parallax.builtin.systemd
Aliases: ansible.builtin.systemd, systemd
Synopsis
Manage systemd units, including daemon reloads and masking
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | Name of the systemd unit | ||
| state | string | started | Service state Choices: reloaded, restarted, started, stopped | |
| enabled | bool | Whether the service should start on boot | ||
| daemon_reload | bool | false | Run daemon-reload before any action | |
| daemon_reexec | bool | false | Run daemon-reexec command before any action | |
| scope | string | system | Service scope Choices: system, user, global | |
| force | bool | false | Force stop a service by sending SIGKILL | |
| masked | bool | Whether the unit should be masked | ||
| no_block | bool | false | Do not synchronously wait for operation to finish | |
| user | string | Run systemctl as this user (for user services) |
Example
- name: Reload units and restart the app service
systemd:
name: app.service
state: restarted
enabled: true
daemon_reload: true