examples/VM: sless_job provisioning (packages, nginx, docker)

- Add sless.tf: three sless_job resources with depends_on chain
  - vm-install-packages: jq, python3-pip, htop, unzip
  - vm-install-nginx: nginx 1.18 (HTTP 200 verified)
  - vm-install-docker: Docker CE 29.3.1 + Compose v5.1.1
- Add functions/install-{packages,nginx,docker}/handler.py
  - _wait_apt_lock: cloud-init status --wait + systemctl mask
    fixes Ubuntu 22.04 first-boot apt lock (unattended-upgrades)
  - DPkg::Lock::Timeout=600 on all apt-get calls
- Add variables.tf (install_run_id, vm_public_key, vm_private_key)
- Add outputs.tf (install_*_result)
- Bump nubes provider 5.0.49 -> 5.0.51
- doc/progress.md: document step 6 with bug analysis
This commit is contained in:
Naeel
2026-03-29 19:54:00 +03:00
parent b4c2e7f6b1
commit fef441681e
13 changed files with 1160 additions and 8 deletions
+37
View File
@@ -0,0 +1,37 @@
# 2026-03-29 — variables.tf: переменные для sless и установки ПО на ВМ.
# Переменные nubes (api_token, vm_public_key) остаются в main.tf.
# sless использует тот же api_token — отдельной переменной не нужно.
# ---- Флаги: что устанавливать на ВМ --------------------------------------
variable "install_packages" {
type = bool
default = true
description = "Установить базовые apt-пакеты (jq и др.)"
}
variable "install_nginx" {
type = bool
default = false
description = "Установить nginx"
}
variable "install_docker" {
type = bool
default = false
description = "Установить Docker CE + docker-compose-plugin"
}
# ---- Параметры ------------------------------------------------------------
variable "base_packages" {
type = list(string)
default = ["jq", "python3-pip", "htop", "unzip"]
description = "Список apt-пакетов для install-packages"
}
variable "install_run_id" {
type = number
default = 1
description = "Увеличь на 1 чтобы запустить все install-джобы заново"
}