aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ansible')
-rw-r--r--ansible/update_adjutor.yml20
-rw-r--r--ansible/update_nginx.yml37
2 files changed, 35 insertions, 22 deletions
diff --git a/ansible/update_adjutor.yml b/ansible/update_adjutor.yml
index 562a083..2724a30 100644
--- a/ansible/update_adjutor.yml
+++ b/ansible/update_adjutor.yml
@@ -1,10 +1,12 @@
---
- - name: Update the server
- hosts: vps
- become: yes
- tasks:
- - name : Update and upgrade apt packages
- apt:
- update_cache: yes
- upgrade: yes
- autoremove: yes
+- name: Update the server
+ hosts: vps
+ become: true
+ tasks:
+
+ - name: Update and upgrade apt packages
+ ansible.builtin.apt:
+ update_cache: true
+ upgrade: true
+ autoremove: true
+...
diff --git a/ansible/update_nginx.yml b/ansible/update_nginx.yml
index fd5335d..4813e6c 100644
--- a/ansible/update_nginx.yml
+++ b/ansible/update_nginx.yml
@@ -1,14 +1,25 @@
---
- - name: Update nginx if needed
- hosts: vps
- become: yes
- become_user: root
- tasks:
- - name: ensure nginx is at the latest version
- apt:
- name: nginx
- state: latest
- - name: ensure nginx is running
- service:
- name: nginx
- state: started
+- 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
+...