- hosts: all become: true tasks: - apt: name: nginx state: present update_cache: true - service: name: nginx state: started enabled: true