From 5e5cc9f735ec64b2e70a6bfe9ce28bde4a97c435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Mon, 19 Aug 2024 17:24:20 +0200 Subject: [PATCH] feat(yggdrasil): add support for Chimera Linux --- roles/yggdrasil/handlers/main.yml | 10 ++++++++++ roles/yggdrasil/tasks/configure/service.yml | 12 ++++++++++++ roles/yggdrasil/tasks/install.yml | 4 ++++ roles/yggdrasil/tasks/install/chimera.yml | 8 ++++++++ 4 files changed, 34 insertions(+) create mode 100644 roles/yggdrasil/tasks/install/chimera.yml diff --git a/roles/yggdrasil/handlers/main.yml b/roles/yggdrasil/handlers/main.yml index 9247c73..f7829ce 100644 --- a/roles/yggdrasil/handlers/main.yml +++ b/roles/yggdrasil/handlers/main.yml @@ -14,3 +14,13 @@ state: restarted when: ansible_os_family in ["Void"] listen: "restart_yggdrasil" + +- name: Restart yggdrasil using dinit + ansible.builtin.command: + argv: + - dinitctl + - --system + - restart + - yggdrasil + when: ansible_os_family in ["Chimera"] + listen: "restart_yggdrasil" diff --git a/roles/yggdrasil/tasks/configure/service.yml b/roles/yggdrasil/tasks/configure/service.yml index 0354207..422e653 100644 --- a/roles/yggdrasil/tasks/configure/service.yml +++ b/roles/yggdrasil/tasks/configure/service.yml @@ -14,3 +14,15 @@ enabled: true state: started when: ansible_os_family in ["Void"] + +# This separate entry here is needed because +# the service module does not support dinit +- name: Start yggdrasil + ansible.builtin.command: + argv: + - /usr/bin/dinitctl + - --system + - enable + - yggdrasil + creates: /etc/dinit.d/boot.d/yggdrasil + when: ansible_os_family in ["Chimera"] diff --git a/roles/yggdrasil/tasks/install.yml b/roles/yggdrasil/tasks/install.yml index d9195a7..defecc4 100644 --- a/roles/yggdrasil/tasks/install.yml +++ b/roles/yggdrasil/tasks/install.yml @@ -15,4 +15,8 @@ ansible.builtin.import_tasks: install/arch.yml when: ansible_os_family in ["Archlinux"] +- name: Import chimera tasks + ansible.builtin.import_tasks: install/chimera.yml + when: ansible_os_family in ["Chimera"] + # TODO: Support more distros (and maybe even Windows one day) diff --git a/roles/yggdrasil/tasks/install/chimera.yml b/roles/yggdrasil/tasks/install/chimera.yml new file mode 100644 index 0000000..09cac7e --- /dev/null +++ b/roles/yggdrasil/tasks/install/chimera.yml @@ -0,0 +1,8 @@ +--- +- name: Install yggdrasil + community.general.apk: + name: yggdrasil + register: task_result + until: task_result is success + retries: 3 + delay: 2