From c569b582c3718c7856306b2b0ab1b1397e8770eb Mon Sep 17 00:00:00 2001 From: exu Date: Sun, 13 Oct 2024 20:37:03 +0200 Subject: [PATCH] Add host-specific packages --- host_vars/NB-XKJIMECZ.yml | 3 +++ roles/packages/tasks/main.yml | 24 +++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 host_vars/NB-XKJIMECZ.yml diff --git a/host_vars/NB-XKJIMECZ.yml b/host_vars/NB-XKJIMECZ.yml new file mode 100644 index 00000000..73d63edf --- /dev/null +++ b/host_vars/NB-XKJIMECZ.yml @@ -0,0 +1,3 @@ +additional_pacman_packages: + - mattermost-desktop + - wireguard-tools diff --git a/roles/packages/tasks/main.yml b/roles/packages/tasks/main.yml index 78b97be7..be0530de 100644 --- a/roles/packages/tasks/main.yml +++ b/roles/packages/tasks/main.yml @@ -33,7 +33,6 @@ - name: Install other packages community.general.pacman: state: present - # select the lines and use 'M-x sort-lines' name: "{{ item }}" loop: #- gnome-keyring @@ -176,7 +175,6 @@ - name: x86_64 | Install other packages unavailable/unnecessary on ALARM community.general.pacman: state: present - # select the lines and use 'M-x sort-lines' name: "{{ item }}" loop: - amd-ucode # microcode @@ -207,7 +205,6 @@ - name: x86_64 | Install multilib packages community.general.pacman: state: present - # select the lines and use 'M-x sort-lines' name: "{{ item }}" loop: - lib32-mesa # video driver @@ -219,6 +216,27 @@ tags: packages become: true +- name: Host | Check if host variables exist + ansible.builtin.stat: + path: "host_vars/{{ ansible_hostname }}.yml" + register: host_file + tags: packages + +- name: Host | Get host specific variables + include_vars: + file: "host_vars/{{ ansible_hostname }}.yml" + when: host_file.stat.exists + tags: packages + +- name: Host | Install host specific packages + community.general.pacman: + state: present + name: "{{ item }}" + loop: "{{ additional_pacman_packages|default([]) }}" + when: host_file.stat.exists + become: true + tags: packages + - name: Doom Emacs | Clone ansible.builtin.git: repo: https://github.com/doomemacs/doomemacs