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