home lab init

This commit is contained in:
plasmagoat 2025-06-03 23:07:46 +02:00
commit 7278922625
65 changed files with 27336 additions and 0 deletions

View file

@ -0,0 +1,26 @@
- name: Build and Upload NixOS Image
hosts: nodes
vars:
current_date: "{{ ansible_date_time.date }}"
flake_name: "{{ flake | default('proxmox') }}"
tasks:
- name: create iso
ansible.builtin.shell: nix build .#{{ flake_name }}
args:
chdir: "{{ playbook_dir }}/../../nixos/nixos-base-image"
delegate_to: localhost
run_once: true
- name: copy the backup
ansible.builtin.copy:
src: "{{ item }}"
dest: "/var/lib/vz/dump/"
with_fileglob:
- "{{ playbook_dir }}/../../nixos/nixos-base-image/result/*.zst"
- name: remove build result
ansible.builtin.file:
path: "{{ playbook_dir }}/../../nixos/nixos-base-image/result"
state: absent
delegate_to: localhost
run_once: true