ansible all -m systemd -a 'name=nginx enabled=yes state=started' -b

Category: IaC & Automation

ansible all -m systemd -a 'name=nginx enabled=yes state=started' -b

Enable and start nginx via systemd on all hosts

Configures the nginx unit to start now and on every boot using the systemd module, which speaks directly to modern init systems. Setting both enabled and state keeps services healthy across reboots. Related: ansible 'web*' -m service.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.