From 7f850fb89c2202c4f7acbf0db69206c88419a129 Mon Sep 17 00:00:00 2001 From: Ivan Cvitkovic Date: Mon, 25 Sep 2023 22:19:48 -0700 Subject: [PATCH] Add SAN role and hosts --- hosts.ini | 3 +++ local.yml | 5 +++++ roles/san/handlers/main.yaml | 4 ++++ roles/san/tasks/main.yaml | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 roles/san/handlers/main.yaml create mode 100644 roles/san/tasks/main.yaml diff --git a/hosts.ini b/hosts.ini index ccbc09f..1add215 100644 --- a/hosts.ini +++ b/hosts.ini @@ -7,6 +7,9 @@ scyther scizor rpi3 docker_install_compose=false +[san] +dodrio + [gui] steelix scyther diff --git a/local.yml b/local.yml index d2246b1..1fc283d 100644 --- a/local.yml +++ b/local.yml @@ -32,6 +32,11 @@ roles: - stream_host +- name: Install roles for SAN hosts + hosts: san + roles: + - san + - name: Install roles for GUI hosts hosts: gui roles: diff --git a/roles/san/handlers/main.yaml b/roles/san/handlers/main.yaml new file mode 100644 index 0000000..2200dc3 --- /dev/null +++ b/roles/san/handlers/main.yaml @@ -0,0 +1,4 @@ +--- +- name: Update package lists + ansible.builtin.apt: + update_cache: yes diff --git a/roles/san/tasks/main.yaml b/roles/san/tasks/main.yaml new file mode 100644 index 0000000..fa81cc6 --- /dev/null +++ b/roles/san/tasks/main.yaml @@ -0,0 +1,26 @@ +--- +- name: Install required packages + ansible.builtin.apt: + name: "{{ packages }}" + vars: + packages: + - software-properties-common + +- name: Add non-free sources + ansible.builtin.command: apt-add-repository contrib + register: add_component_result + notify: + - Update package lists + changed_when: '"component enabled" in add_component_result.stdout' + +- name: Flush all notified handlers + ansible.builtin.meta: flush_handlers + +- name: Install ZFS packages + ansible.builtin.apt: + name: "{{ packages }}" + vars: + packages: + - linux-headers-amd64 + - zfs-dkms + - zfsutils-linux