Refactor ansible inventory to add dev server

This commit is contained in:
2024-06-30 16:46:04 +08:00
parent a896598eb0
commit d3ef4cd14a
27 changed files with 1095 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
- name: Upgrade everything on the cluster.
hosts: test
become: true
tasks:
- name: Upgrade all software.
ansible.builtin.apt:
update_cache: true
upgrade: dist
- name: Check if a reboot is required.
stat:
path: /var/run/reboot-required
register: reboot_required_file
- name: Reboot the server (if required).
reboot:
when: reboot_required_file.stat.exists == true
- name: Remove dependencies that are no longer required.
apt:
autoremove: yes