From eae7345be7aad53d5f479e5aff1674dfa36ae040 Mon Sep 17 00:00:00 2001 From: marito Date: Sat, 14 Jun 2025 08:29:11 +0800 Subject: [PATCH] admin init fixed --- playbook.yml | 8 ++++++-- preseed-network-storage.yml | 13 ------------- preseed-profile.yml | 26 -------------------------- 3 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 preseed-network-storage.yml delete mode 100644 preseed-profile.yml diff --git a/playbook.yml b/playbook.yml index 7074541..ee0c728 100644 --- a/playbook.yml +++ b/playbook.yml @@ -11,7 +11,6 @@ repo_file: "/etc/apt/sources.list.d/zabbly-incus-stable.sources" os_codename: "{{ ansible_lsb.codename }}" arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else ansible_architecture }}" - # Get the non-root user who invoked sudo for group membership target_user: "{{ lookup('env', 'SUDO_USER') | default(lookup('env', 'USER'), true) }}" tasks: @@ -21,6 +20,11 @@ state: present update_cache: yes + - name: Ensure ZFS support is installed + apt: + name: zfsutils-linux + state: present + - name: Create APT keyring directory file: path: "{{ keyring_dir }}" @@ -68,7 +72,7 @@ changed_when: false - name: Initialize Incus daemon with preseed file (if not already initialized) - shell: "cat {{ playbook_dir }}/preseed-full.yml | incus admin init --preseed" + script: init-incus.sh args: chdir: "{{ playbook_dir }}" when: incus_check.rc != 0 diff --git a/preseed-network-storage.yml b/preseed-network-storage.yml deleted file mode 100644 index a843a92..0000000 --- a/preseed-network-storage.yml +++ /dev/null @@ -1,13 +0,0 @@ -networks: -- config: - ipv4.address: 10.69.69.1/24 - ipv4.nat: "true" - ipv6.address: none - name: incusbr0 - type: bridge - -storage_pools: -- config: - source: /var/lib/incus/storage-pools/default - name: default - driver: dir diff --git a/preseed-profile.yml b/preseed-profile.yml deleted file mode 100644 index 7d26b31..0000000 --- a/preseed-profile.yml +++ /dev/null @@ -1,26 +0,0 @@ -profiles: -- name: default - config: {} - description: Default Incus profile - devices: - eth0: - name: eth0 - network: incusbr0 - type: nic - root: - path: / - pool: default - type: disk - -config: - core.https_address: :8443 - -projects: -- name: default - config: - features.images: "true" - features.networks: "true" - features.profiles: "true" - features.storage.volumes: "true" - features.storage.buckets: "true" - features.networks.zones: "true"