admin init fixed

This commit is contained in:
marito 2025-06-14 08:29:11 +08:00
parent 75d9d95483
commit eae7345be7
3 changed files with 6 additions and 41 deletions

View File

@ -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

View File

@ -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

View File

@ -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"