aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/nginx/tasks/update_nginx.yml
blob: ffe2725436fcce27db786fcc9f401402f96debf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
- name: Update nginx if needed
  hosts: vps
  become: true
  become_user: root
  tasks:

    - name: Ensure nginx is at the latest version
      ansible.builtin.package:
        name: nginx
        state: latest
      notify: restart nginx

    - name: Ensure nginx is running
      ansible.builtin.service:
        name: nginx
        state: started
        enabled: true
...