ansible all -m apt -a 'name=nginx state=latest' -b

Category: IaC & Automation

ansible all -m apt -a 'name=nginx state=latest' -b

Ensure nginx is at the latest version on Debian hosts

Uses the apt module to make sure nginx is installed and current on every host, with -b (become) elevating to root for package operations. The module is idempotent, so repeated runs change nothing once the package is up to date. Related: ansible all -m service.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.