From f1cb97161674b6be4a1b3045247f041abc9b951b Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Fri, 31 Jan 2025 16:56:39 +0100 Subject: ansible: moving ansible content from scripts repo to here --- ansible/roles/nginx/update_nginx.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ansible/roles/nginx/update_nginx.yml (limited to 'ansible/roles/nginx/update_nginx.yml') diff --git a/ansible/roles/nginx/update_nginx.yml b/ansible/roles/nginx/update_nginx.yml new file mode 100644 index 0000000..4813e6c --- /dev/null +++ b/ansible/roles/nginx/update_nginx.yml @@ -0,0 +1,25 @@ +--- +- 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 + + handlers: + - name: Restart nginx + ansible.builtin.service: + name: nginx + state: restarted +... -- cgit v1.2.3