Ayatori 容器镜像改为跟随 24.04 cloud 最新构建
ansible / collection-test (pull_request) Successful in 13m34s
yaml / yaml (pull_request) Successful in 14m10s
ansible / lint (pull_request) Successful in 14m24s
terraform / validate (pull_request) Successful in 15m12s

固定指纹会随上游下架而无法重建(2026-10-01 已发生),同一发行版的构建之间
只差安全更新,固定它没有收益。镜像只在创建时使用,ignore_changes 避免改写
别名时触发重建现有实例。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-01 17:12:49 +00:00
co-authored by Claude Opus 5.5
parent 094b38b4b5
commit 9f7b1b98dd
2 changed files with 7 additions and 8 deletions
+3 -4
View File
@@ -130,10 +130,9 @@ terraform -chdir=infrastructure/incus/terraform output containers
terraform -chdir=infrastructure/incus/terraform plan -detailed-exitcode terraform -chdir=infrastructure/incus/terraform plan -detailed-exitcode
``` ```
provider 固定 1.2.0 并保留 lockfile,镜像固定 Ubuntu 24.04 cloud 构建指纹。 provider 固定 1.2.0 并保留 lockfile。镜像跟随 `images:ubuntu/24.04/cloud` 最新构建,
上游滚动镜像不保证永久保存:该指纹在 2026-10-01 已从 `images:` 下架,现从 `local:` 只在创建时使用(`ignore_changes`);不固定指纹,因为上游会下架旧构建,2026-10-01
缓存创建;缓存闲置超过 `images.remote_cache_expiry`(默认 10 天)会被自动删除,重建前需确认 重建时固定指纹已无法获取。
本机缓存或归档可用,否则须改用新指纹。
cloud-init 用户设置主要在首次启动执行,修改声明不能替代后续用户/密钥轮换流程。 cloud-init 用户设置主要在首次启动执行,修改声明不能替代后续用户/密钥轮换流程。
当前 state 位于 `terraform/terraform.tfstate`(Git 忽略),是本地 backend; 当前 state 位于 `terraform/terraform.tfstate`(Git 忽略),是本地 backend;
+4 -4
View File
@@ -48,10 +48,8 @@ resource "incus_instance" "ayatori" {
for_each = toset(["dev", "prod"]) for_each = toset(["dev", "prod"])
name = "ayatori-${each.key}" name = "ayatori-${each.key}"
description = "Ayatori ${each.key} 基础容器;应用由独立部署流程管理" description = "Ayatori ${each.key} 基础容器;应用由独立部署流程管理"
# Ubuntu 24.04 cloud amd64,20260924_07:42;固定指纹避免重建时静默更换镜像。 # 跟随 24.04 cloud 最新构建:同一发行版的构建只差安全更新,固定指纹会随上游下架而无法重建。
# 上游 images: 已不再提供该构建(2026-10-01 重建时 "image couldn't be found"),只能取本机缓存; image = "images:ubuntu/24.04/cloud"
# ⚠ 缓存镜像闲置超过 images.remote_cache_expiry(默认 10 天)会被 Incus 自动删除。
image = "local:b39d3d56c30738ad74c507066cc5d410e1c0f1647bdcdff398be1ee51d63862a"
type = "container" type = "container"
profiles = [] profiles = []
running = true running = true
@@ -114,6 +112,8 @@ resource "incus_instance" "ayatori" {
nic = "eth0" nic = "eth0"
} }
lifecycle { lifecycle {
# 镜像只在创建时使用;provider 按字符串比较,改写它不应触发重建现有实例。
ignore_changes = [image]
prevent_destroy = true prevent_destroy = true
} }
} }