initialization fixed

This commit is contained in:
marito 2025-06-14 09:06:28 +08:00
parent eae7345be7
commit 4272b071e4
2 changed files with 31 additions and 6 deletions

View File

@ -28,7 +28,6 @@ This playbook automates the installation and setup of the **stable** version of
## Post-Installation Instructions
After the playbook completes successfully:
1. **Configure User Access:**
Refresh group membership.
@ -36,7 +35,6 @@ After the playbook completes successfully:
```bash
newgrp incus-admin
```
2. **Verify Setup:**
You can test the installation by running.
@ -45,7 +43,22 @@ After the playbook completes successfully:
incus --version
```
3. **Enable and Access the Incus Web UI:**
3. **Check Incus Initialization:**
Try checking the storage:
```bash
incus storage show default
```
> If the display is: 'Error: Storage pool not found' then initialize it through interactive mode:
Try interactive mode if initialization failed:
```bash
incus admin init
```
4. **Enable and Access the Incus Web UI:**
Enable port 8443:
@ -62,7 +75,7 @@ After the playbook completes successfully:
> Follow the self-signed certificate instructions when prompted for mLTS
4. **Incus Network - Access Containers by Name (Optional):**
5. **Incus Network - Access Containers by Name (Optional):**
Configuring name-to-IP resolution so the host OS can reach Incus containers using their names.

View File

@ -65,17 +65,29 @@
name: [incus, incus-client, incus-ui-canonical, ufw]
state: present
- name: Check if Incus is already initialized (by checking for default storage pool)
- name: Check if Incus storage pool 'default' exists
command: incus storage show default
register: incus_check
failed_when: false
changed_when: false
- name: Check if Incus bridge 'incusbr0' exists
command: incus network show incusbr0
register: net_check
failed_when: false
changed_when: false
- name: Check if default profile exists
command: incus profile show default
register: profile_check
failed_when: false
changed_when: false
- name: Initialize Incus daemon with preseed file (if not already initialized)
script: init-incus.sh
args:
chdir: "{{ playbook_dir }}"
when: incus_check.rc != 0
when: incus_check.rc != 0 and net_check.rc != 0 and profile_check.rc != 0
- name: Add target user to the incus-admin group for passwordless access
user: