Fix(judgehost): works with Debian12 + docker

This commit is contained in:
2025-04-07 20:32:38 +08:00
parent 320037ecdf
commit 83a95fe49c
12 changed files with 231 additions and 31 deletions

View File

@@ -1,6 +1,10 @@
---
- name: Reboot
ansible.builtin.reboot: {}
- name: Update grub
ansible.builtin.command: |
update-grub
changed_when: true
- name: Restart judgehost docker compose
community.docker.docker_compose_v2:
project_src: "{{ domjudge_base_dir }}"

View File

@@ -1,10 +1,23 @@
---
- name: Add boot parameters
- name: Add boot parameters (Archlinux)
ansible.builtin.lineinfile:
path: /boot/loader/entries/arch.conf
line: >-
options cgroup_enable=memory
notify: Reboot
when: ansible_facts['distribution'] == "Archlinux"
- name: Add boot parameters (Debian)
ansible.builtin.lineinfile:
path: /etc/default/grub
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT='
line: >-
GRUB_CMDLINE_LINUX_DEFAULT="quiet
cgroup_enable=memory swapaccount=1 isolcpus=0
systemd.unified_cgroup_hierarchy=0"
notify:
- Update grub
- Reboot
when: ansible_facts['distribution'] == "Debian"
- name: Flush handlers
ansible.builtin.meta: flush_handlers