aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclyhtsuriva <aimeric@adjutor.xyz>2022-11-02 22:34:23 +0100
committerclyhtsuriva <aimeric@adjutor.xyz>2022-11-02 22:34:23 +0100
commit6b372364a4adca1cbcc9114c0d86712e9df0e420 (patch)
treeadf25679564426e8236c8dbd7c979d8065cbea85
parent093fc7bfae47a3ee91c2658bac609f72764b4be2 (diff)
Adding ansible YAML files
-rw-r--r--.gitignore1
-rw-r--r--ansible/update_adjutor.yml10
-rw-r--r--ansible/update_nginx.yml14
3 files changed, 25 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 6b651e0..5f3858f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
auto-void-packages/needs_update.txt
+ansible/hosts
diff --git a/ansible/update_adjutor.yml b/ansible/update_adjutor.yml
new file mode 100644
index 0000000..562a083
--- /dev/null
+++ b/ansible/update_adjutor.yml
@@ -0,0 +1,10 @@
+---
+ - name: Update the server
+ hosts: vps
+ become: yes
+ tasks:
+ - name : Update and upgrade apt packages
+ apt:
+ update_cache: yes
+ upgrade: yes
+ autoremove: yes
diff --git a/ansible/update_nginx.yml b/ansible/update_nginx.yml
new file mode 100644
index 0000000..fd5335d
--- /dev/null
+++ b/ansible/update_nginx.yml
@@ -0,0 +1,14 @@
+---
+ - 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