Manage Services with systemd
Start, stop and enable services.
Manage Long-Running Services
The systemd module controls services managed by systemd, the init system on most modern Linux distros. You start, stop, and enable them with it.
Start a Service
Give the service name and set state: started. The module starts it only if it is not already running, staying idempotent.
ansible.builtin.systemd:
name: nginx
state: startedAll lessons in this course
- What a Module Actually Is
- Install Packages with the package Module
- Manage Services with systemd
- Read the Docs with ansible-doc