From 54e5783394a2bff2b785b63a28ba44436c97d51d Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Fri, 13 Jan 2023 11:42:54 -0800 Subject: config: add zfs on linux --- clarkzjw.ca/config/atlas/ansible.cfg | 14 ++++++ clarkzjw.ca/config/atlas/inventory/atlas.yaml | 1 + clarkzjw.ca/config/atlas/requirements.yaml | 6 +++ clarkzjw.ca/config/atlas/role.yaml | 3 ++ .../atlas/roles/debian_init/defaults/main.yaml | 0 .../config/atlas/roles/debian_init/tasks/main.yaml | 58 ++++++++++++++++++++++ clarkzjw.ca/config/atlas/site.yaml | 3 ++ 7 files changed, 85 insertions(+) create mode 100644 clarkzjw.ca/config/atlas/ansible.cfg create mode 100644 clarkzjw.ca/config/atlas/inventory/atlas.yaml create mode 100644 clarkzjw.ca/config/atlas/requirements.yaml create mode 100644 clarkzjw.ca/config/atlas/role.yaml create mode 100644 clarkzjw.ca/config/atlas/roles/debian_init/defaults/main.yaml create mode 100644 clarkzjw.ca/config/atlas/roles/debian_init/tasks/main.yaml create mode 100644 clarkzjw.ca/config/atlas/site.yaml diff --git a/clarkzjw.ca/config/atlas/ansible.cfg b/clarkzjw.ca/config/atlas/ansible.cfg new file mode 100644 index 0000000..9ad35f3 --- /dev/null +++ b/clarkzjw.ca/config/atlas/ansible.cfg @@ -0,0 +1,14 @@ +[defaults] +host_key_checking = True +transport = ssh +remote_user = clarkzjw +roles_path = roles +inventory = inventory +force_color = True +interpreter_python = auto_silent + +[connection] +pipelining = True + +[privilege_escalation] +become = True diff --git a/clarkzjw.ca/config/atlas/inventory/atlas.yaml b/clarkzjw.ca/config/atlas/inventory/atlas.yaml new file mode 100644 index 0000000..ef8830e --- /dev/null +++ b/clarkzjw.ca/config/atlas/inventory/atlas.yaml @@ -0,0 +1 @@ +atlas diff --git a/clarkzjw.ca/config/atlas/requirements.yaml b/clarkzjw.ca/config/atlas/requirements.yaml new file mode 100644 index 0000000..33f6117 --- /dev/null +++ b/clarkzjw.ca/config/atlas/requirements.yaml @@ -0,0 +1,6 @@ +--- +collections: + - name: community.general + version: 4.7.0 + - name: ansible.posix + version: 1.3.0 diff --git a/clarkzjw.ca/config/atlas/role.yaml b/clarkzjw.ca/config/atlas/role.yaml new file mode 100644 index 0000000..ab3fca5 --- /dev/null +++ b/clarkzjw.ca/config/atlas/role.yaml @@ -0,0 +1,3 @@ +- hosts: "{{ target }}" + roles: + - role: "{{ role }}" diff --git a/clarkzjw.ca/config/atlas/roles/debian_init/defaults/main.yaml b/clarkzjw.ca/config/atlas/roles/debian_init/defaults/main.yaml new file mode 100644 index 0000000..e69de29 diff --git a/clarkzjw.ca/config/atlas/roles/debian_init/tasks/main.yaml b/clarkzjw.ca/config/atlas/roles/debian_init/tasks/main.yaml new file mode 100644 index 0000000..0eefdef --- /dev/null +++ b/clarkzjw.ca/config/atlas/roles/debian_init/tasks/main.yaml @@ -0,0 +1,58 @@ +- name: Disable unattended-upgrades + systemd: + name: unattended-upgrades + state: stopped + enabled: false + +- name: Install packages + apt: + name: + - apt-transport-https + - build-essential + - ca-certificates + - cifs-utils + - vnstat + - postfix + - lsb-release + - python3 + - python3-dev + - python3-pip + - unzip + - gnupg + - rsync + - htop + - curl + - tree + - zip + - vim + - zsh + - git + update_cache: true + +- name: Enable bullseye-backport + apt_repository: + repo: deb https://deb.debian.org/debian {{ ansible_distribution_release | lower }}-backports main contrib non-free + state: present + +# Check https://wiki.debian.org/ZFS for additional information +- name: Install ZFS + apt: + name: + - linux-headers-amd64 + - zfsutils-linux + update_cache: true + fail_on_autoremove: yes + default_release: "{{ ansible_distribution_release | lower }}-backports" + +- name: Clean unneeded packages + apt: + autoremove: true + purge: true + +- name: Remove useless packages from the cache + apt: + autoclean: yes + +- name: Run the equivalent of "apt-get clean" as a separate step + apt: + clean: yes diff --git a/clarkzjw.ca/config/atlas/site.yaml b/clarkzjw.ca/config/atlas/site.yaml new file mode 100644 index 0000000..e51573e --- /dev/null +++ b/clarkzjw.ca/config/atlas/site.yaml @@ -0,0 +1,3 @@ +- hosts: atlas + roles: + - role: debian_init -- cgit v1.2.3