empeira 0.1.0.pre.alpha.7 → 0.1.0.pre.alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0b0c2558d0799e27a8985ab84de156e8de49741ec078965338d0c1638ab0d3
4
- data.tar.gz: 5607b7c52a5fb130b7a8534318aecb89c0093709ea7d9b65fcccef86da745fab
3
+ metadata.gz: c591e897dd6bfa42a6aa67789efaecfa87be8df2f05c1fefd2328c52a262fefb
4
+ data.tar.gz: 2e35e9d3595d3a8b5dd228b42b11827938678b900496c08acd8161b278bf1c3a
5
5
  SHA512:
6
- metadata.gz: 5a0eaa2c61a33c12d49632cfa4690f9e369bbae26a1d4cf4f9b1c5ae0d3178d6aed0f14f28721d1a83e1332319b02cf5a899f8f31287b88816b2e2e7ba3e8366
7
- data.tar.gz: ed8ab5306f5948ed1f81c8e1b00121cb6360490e35daf915b95c441a42174552320b08fcc37a193eb2e1011b694eb1f85932739df3ee0d2274b182fded0b6957
6
+ metadata.gz: 1fd4fa8fc1eb99ee06c4499d300758cdbbd341927702cdc536dbf814d115020c0f714cd67d1825bdf97bdc48b0ebf895ad3cc095855b1408e6dde4af9f568d4c
7
+ data.tar.gz: f6705a2b8d7b43b732ed5f3ffaf68c051564567a14834bf28cca9dba4e93f6b1a1a8b951828ecdd9d25c2e59c1a166513521aaaa91e087af09a47324579fc92a
data/README.md CHANGED
@@ -92,7 +92,7 @@ empeira node exec host1 -- id
92
92
  empeira node shell host1
93
93
  ```
94
94
 
95
- `node run` creates an Ubuntu 24.04 container, installs the default OpenVox Agent,
95
+ `node run` creates an Ubuntu 26.04 container, installs the default OpenVox Agent,
96
96
  enrolls its certificate and applies the catalog. Inside the shell, inspect
97
97
  `/tmp/empeira-example`; `exit` returns to the host. Select Docker with
98
98
  `--container-engine docker` when Podman is not installed. Optional workstation
@@ -138,7 +138,8 @@ cooperative lab, and its internal PuppetDB API is unauthenticated.
138
138
  Container process mode does not provide a full booted OS. Systemd requires Podman
139
139
  and cgroup v2. VM and shared-network support require actual host capabilities;
140
140
  macOS/HVF and arm64 runtime validation are manual gates. Native Windows, automatic
141
- self-update, aggregate `update all` and standalone platform binaries are unavailable.
141
+ self-update and standalone platform binaries are unavailable. RubyGems installations
142
+ support explicit `self-update` and `update all` commands.
142
143
  Distribution is through RubyGems.org and the matching GitHub Release gem asset.
143
144
 
144
145
  ## Community and license
data/bin/empeira CHANGED
@@ -6,7 +6,7 @@ require_relative '../lib/empeira/cli/main'
6
6
 
7
7
  begin
8
8
  Empeira::CLI::Main.start(ARGV)
9
- rescue Empeira::Addons::Error => e
9
+ rescue Empeira::Addons::Error, Empeira::Updates::CommandFailed => e
10
10
  $stderr.write "#{e.message}\n"
11
11
  exit e.exit_status
12
12
  rescue Empeira::Error => e
data/config/defaults.yaml CHANGED
@@ -76,10 +76,11 @@ dns:
76
76
  rewrites: []
77
77
  node_defaults:
78
78
  os: ubuntu
79
- version: "24.04"
79
+ version: "26.04"
80
80
  init: process
81
81
  memory: 1024
82
82
  cpus: 2
83
+ puppet_runs: 1
83
84
  hiera:
84
85
  mounts: []
85
86
  eyaml:
@@ -121,11 +122,26 @@ images:
121
122
  tag: "22.04"
122
123
  build: nodes/debian/Containerfile
123
124
  architectures: [amd64, arm64]
125
+ vm:
126
+ url: "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-{architecture}.img"
127
+ checksum_url: "https://cloud-images.ubuntu.com/releases/jammy/release/SHA256SUMS"
124
128
  "24.04":
125
129
  repository: library/ubuntu
126
130
  tag: "24.04"
127
131
  build: nodes/debian/Containerfile
128
132
  architectures: [amd64, arm64]
133
+ vm:
134
+ url: "https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-{architecture}.img"
135
+ checksum_url: "https://cloud-images.ubuntu.com/releases/noble/release/SHA256SUMS"
136
+ "26.04":
137
+ repository: library/ubuntu
138
+ tag: "26.04"
139
+ digest: "sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db"
140
+ build: nodes/debian/Containerfile
141
+ architectures: [amd64, arm64]
142
+ vm:
143
+ url: "https://cloud-images.ubuntu.com/releases/resolute/release/ubuntu-26.04-server-cloudimg-{architecture}.img"
144
+ checksum_url: "https://cloud-images.ubuntu.com/releases/resolute/release/SHA256SUMS"
129
145
  rocky:
130
146
  "8":
131
147
  repository: rockylinux/rockylinux
@@ -172,6 +188,11 @@ agent:
172
188
  destinations: [apt.voxpupuli.org]
173
189
  sha256: "40b8052bcece23ed707e609504dd14b178dc662652455f2d30e9c8e614955a94"
174
190
  suffix: "-1+ubuntu24.04"
191
+ ubuntu26.04:
192
+ url: "https://apt.voxpupuli.org/openvox8-release-ubuntu26.04.deb"
193
+ destinations: [apt.voxpupuli.org]
194
+ sha256: "aa9726d90965b6701a546713e3dfa583b121be544ef1ee021254c2410d51ae4e"
195
+ suffix: "-1+ubuntu26.04"
175
196
  el8:
176
197
  url: "https://yum.voxpupuli.org/openvox8-release-el-8.noarch.rpm"
177
198
  destinations: [yum.voxpupuli.org]
@@ -205,6 +226,9 @@ bootstrap:
205
226
  "24.04":
206
227
  agent_preinstalled: false
207
228
  destinations: [archive.ubuntu.com, security.ubuntu.com, ports.ubuntu.com]
229
+ "26.04":
230
+ agent_preinstalled: false
231
+ destinations: [archive.ubuntu.com, security.ubuntu.com, ports.ubuntu.com]
208
232
  rocky:
209
233
  "8":
210
234
  agent_preinstalled: false
@@ -118,7 +118,7 @@ proxy:
118
118
  allow: []
119
119
  node_defaults:
120
120
  os: ubuntu
121
- version: "24.04"
121
+ version: "26.04"
122
122
  memory: 2048
123
123
  cpus: 2
124
124
  puppetdb:
@@ -173,10 +173,11 @@ release version. A partial project mapping may omit it and inherit the default.
173
173
  | `dns.rewrites` | Exact external hostnames mapped to enabled `<service>.empeira.internal` targets; `[]` by default |
174
174
  | `hiera.mounts` | Puppet-aware module/environment mounts, `[]`; each source is optional unless `required: true` |
175
175
  | `node_defaults.os` | Configured node OS family, default `ubuntu` |
176
- | `node_defaults.version` | OS version string, default `"24.04"` |
176
+ | `node_defaults.version` | OS version string, default `"26.04"` |
177
177
  | `node_defaults.init` | `process` by default; `systemd` requires supported Podman/cgroup v2 |
178
178
  | `node_defaults.memory` | Positive integer MiB, `1024` |
179
179
  | `node_defaults.cpus` | Positive integer, `2` |
180
+ | `node_defaults.puppet_runs` | Integer from `1` to `10`, default `1`; initial `node run` only |
180
181
  | `mocks.commands` | Named command stubs for test nodes, `{}`; each requires `path`, `mock_to` and `exit_code` |
181
182
  | `puppetdb.enabled` | Boolean, `true` |
182
183
  | `eyaml.enabled` | Boolean, `false`; requires both key paths when enabled |
@@ -479,8 +480,9 @@ Invalid expressions fail validation at `requirements.empeira`.
479
480
  Before `up`, `down` or `destroy` takes a lock or mutates infrastructure/state, the central
480
481
  build abstraction verifies this requirement. Incompatible releases fail with the
481
482
  required and installed versions and the `empeira self-update` command. Self-update
482
- itself is not implemented yet, so install a compatible build through your existing
483
- installation method. Infrastructure operations never update Empeira automatically.
483
+ updates regular RubyGems installations independently of the project configuration.
484
+ Git checkouts and Bundler must use their existing installation method.
485
+ Infrastructure operations never update Empeira automatically.
484
486
  `--version`, `config show`, `config validate`, and `status` remain usable on mismatch.
485
487
  If project or user configuration cannot be loaded, `destroy` uses built-in defaults
486
488
  and the validated workspace inventory for recovery. An unreadable requirement cannot
@@ -551,10 +553,11 @@ no transport selector or additional management YAML configuration. See
551
553
 
552
554
  ## Images and bootstrap
553
555
 
554
- `images.nodes` selects container recipes and base images. VM image sources currently
555
- resolve reviewed Ubuntu/Rocky upstream URLs in the image-source adapter; they are
556
- not configurable through an `images.vm` namespace. A custom adapter can be injected
557
- at the provider boundary. `bootstrap.guests` records whether an agent is preinstalled
556
+ `images.nodes` selects container recipes and base images. Ubuntu entries also contain
557
+ `vm.url` and `vm.checksum_url`, HTTPS URLs for the cloud image and its SHA-256 manifest.
558
+ The optional `{architecture}` placeholder expands to `amd64` or `arm64`; credentials,
559
+ query strings and URL fragments are rejected. Reviewed sources live in `config/defaults.yaml`.
560
+ Rocky sources retain their existing adapter. `bootstrap.guests` records whether an agent is preinstalled
558
561
  and the reviewed destination domains that the temporary bootstrap proxy may reach.
559
562
  Rocky metadata also supplies the stable `baseurl` needed to avoid arbitrary mirror
560
563
  selection. Ubuntu and Debian package source URLs come exclusively from the base
@@ -595,7 +598,7 @@ Configure only the manager you use. A project `apt.default` or `dnf.default`
595
598
  supersedes the built-in release sources for that family. OS-specific entries
596
599
  merge over the generic default; existing complete source definitions and `suffix`
597
600
  overrides remain supported. APT suites default to `jammy` for Ubuntu 22.04 and
598
- `noble` for Ubuntu 24.04. RPM keys remain `el8`/`el9` for Rocky, AlmaLinux and
601
+ `noble` for Ubuntu 24.04, and `resolute` for Ubuntu 26.04. RPM keys remain `el8`/`el9` for Rocky, AlmaLinux and
599
602
  Oracle Linux's existing supported releases. Architecture comes from the target
600
603
  node: `amd64`/`arm64` for DEB and `x86_64`/`aarch64` for RPM. Only `$suite`,
601
604
  `$releasever` and `$basearch` URL placeholders are expanded; arbitrary environment
@@ -1234,3 +1237,19 @@ or `expose` schema. `images.network_adapter_builder` selects the reviewed Go bui
1234
1237
  image used by the existing recipe-hash image cache; Go is not a host prerequisite.
1235
1238
  Node IP/MAC leases survive stop/start and are released on destroy. See
1236
1239
  [networking](networking.md) for address pools, isolation and platform validation.
1240
+
1241
+ ### Initial Puppet runs
1242
+
1243
+ ```yaml
1244
+ node_defaults:
1245
+ puppet_runs: 4
1246
+ ```
1247
+
1248
+ `empeira node run` runs the agent sequentially this many times after bootstrap,
1249
+ network cleanup and enrollment. The default is one; accepted values are integers
1250
+ from one through ten. Every run streams its normal Puppet output and reports its
1251
+ position and detailed exit code. Completed failing catalogs do not stop the sequence:
1252
+ for example, `4, 6, 2, 0` succeeds. The final run decides success (`0` or `2`). A
1253
+ failing final catalog retains the provisioned node for diagnosis and a later retry.
1254
+ Transport failures, timeouts and processes that cannot start abort immediately.
1255
+ `empeira node puppet` still runs once; start and other lifecycle commands add no runs.
data/docs/development.md CHANGED
@@ -378,6 +378,20 @@ and `dry_run` (default true). Dispatch it from `main`; a prerelease tag must mat
378
378
  its channel, for example `v0.1.0-alpha.1`. Other branches and existing tags/releases
379
379
  are rejected. Quality and real Docker/OpenVox gates must pass before the build.
380
380
 
381
+ For GitHub integrations that cannot dispatch Actions directly, create or update
382
+ `.github/release-request.json` in a PR with exactly these fields:
383
+
384
+ ```json
385
+ {"tag":"v0.1.0-alpha.1","channel":"alpha","dry_run":true}
386
+ ```
387
+
388
+ Merging the request to `main` invokes the dedicated dispatcher, which validates
389
+ the tag/channel and calls the same manual release workflow. Keep `dry_run: true`
390
+ for the validation pass; only set `false` in a separate, explicitly approved
391
+ publish request. Both passes run the existing release gates. An ordinary source
392
+ change without a changed request file never triggers publishing. A release request
393
+ PR is not itself a release or proof that its downstream workflow succeeded.
394
+
381
395
  The build uses the existing `rake build_info` task in a temporary source staging
382
396
  directory, builds an installable gem, and checks its contents, license, normalized
383
397
  Gem version and exact embedded metadata. RubyGems normalizes a tag such as
@@ -409,6 +423,15 @@ and the same tag/asset; missing assets, a retained draft or an API error fail th
409
423
  Alpha/beta/rc are prereleases and do not become latest stable.
410
424
  Dry-run performs all quality/build gates but skips the entire publishing job.
411
425
 
426
+ After the GitHub release is published and verified, the same release workflow
427
+ calls the existing `publish-rubygems.yml` workflow as a reusable job. The publisher
428
+ re-downloads and independently verifies the exact GitHub release gem and tag, then
429
+ publishes it to RubyGems.org using its existing OIDC trusted publisher. If the
430
+ GitHub release fails, the RubyGems job is skipped. A RubyGems failure leaves the
431
+ GitHub release intact for diagnosis; the standalone publisher remains available
432
+ to retry that exact release without rebuilding it. Ensure RubyGems trusted
433
+ publishing names `publish-rubygems.yml` as the authorized workflow.
434
+
412
435
  ### Release failure and recovery
413
436
 
414
437
  Tag creation and GitHub release publication are separate operations. A failed run
data/docs/installation.md CHANGED
@@ -241,7 +241,23 @@ The control repository must already be a Git repository. Project commands resolv
241
241
  `.empeira.yaml` at that canonical root. An empty file uses defaults. Subdirectory
242
242
  invocation and paths with spaces work. No Puppet-file heuristic or `--project`
243
243
  selector exists. The source shell function preserves the current directory.
244
- Version/help/self-update work outside Git (self-update currently reports unavailable).
244
+ Version/help/self-update work outside Git. Regular RubyGems installations can update
245
+ to the latest stable Empeira version with:
246
+
247
+ ```console
248
+ empeira self-update
249
+ ```
250
+
251
+ The command uses the current Ruby interpreter and verifies the installed version
252
+ after RubyGems finishes. It never invokes sudo. Git checkouts, Bundler and unsupported
253
+ installations must use their original installation method. Permission and download
254
+ failures retain RubyGems diagnostics.
255
+
256
+ Inside a project, `empeira update all` first performs self-update, then starts
257
+ `empeira update images` and `empeira update modules` in fresh Ruby processes using
258
+ the verified installed version. The first failure stops the sequence and returns
259
+ that command's exit code. These commands update artifacts; existing nodes and
260
+ running infrastructure are not reconciled automatically.
245
261
 
246
262
  ## Install the GitHub Release gem (alternative)
247
263
 
data/docs/networking.md CHANGED
@@ -290,8 +290,24 @@ dns:
290
290
 
291
291
  The optional additional resolver is queried first for non-Empeira names; NXDOMAIN
292
292
  or NODATA falls through to the existing upstream. It may be a DNS name or address
293
- and need not be an Empeira service. `up` activates it after additional services
294
- start. VPN/engine routing remains the host's responsibility; flat Linux resolver
293
+ and need not be an Empeira service. For a managed service, use its service name
294
+ or `<service>.empeira.internal`. `up` requires that service to be enabled and
295
+ running, then binds its verified isolated IPv4 address into CoreDNS. Address changes
296
+ are reconciled on the next `up`; missing services and self references fail clearly.
297
+ External resolver names and IPv4 addresses retain their existing behavior.
298
+
299
+ Before publishing a changed Corefile, `up` starts a disposable CoreDNS validator
300
+ inside the isolated workspace network. It verifies the candidate with a private
301
+ TXT generation query, removes the validator, atomically publishes the file and
302
+ signals the existing DNS process. Completion requires the same generation answer
303
+ from that process. A failed activation restores the previous working Corefile and
304
+ reports any failure to verify restoration. Unchanged `up` does not restart or reload
305
+ CoreDNS. The validation helper never publishes host ports or attaches to an external
306
+ network. Internal names stay authoritative; successful additional-resolver answers
307
+ never fall through to the host upstream. `next NXDOMAIN` and `next_on_nodata` apply
308
+ only to negative or empty answers, respectively.
309
+
310
+ VPN/engine routing remains the host's responsibility; flat Linux resolver
295
311
  files cannot represent every split-DNS route. AAAA queries return NODATA.
296
312
 
297
313
  ### Exact DNS rewrites
data/docs/nodes.md CHANGED
@@ -5,7 +5,7 @@ Create nodes imperatively after `empeira up`; named nodes do not belong in
5
5
  Existing-node commands use the provider recorded in workspace state.
6
6
 
7
7
  ```console
8
- empeira node run host1 --provider container --os ubuntu --version 24.04
8
+ empeira node run host1 --provider container --os ubuntu --version 26.04
9
9
  empeira node run vm1 --provider vm --memory 2048 --cpus 2
10
10
  empeira node list
11
11
  empeira node puppet host1
@@ -19,10 +19,31 @@ empeira node start host1
19
19
  empeira node destroy host1
20
20
  ```
21
21
 
22
- The default node is Ubuntu 24.04, 1024 MiB, and two CPUs. External traffic requires
22
+ The default node is Ubuntu 26.04, 1024 MiB, and two CPUs. External traffic requires
23
23
  an explicit TCP egress rule or an allowlisted proxy policy. If the workspace proxy
24
24
  is enabled, the node automatically gets
25
25
  controlled HTTP/HTTPS access to destinations allowed by its proxy policy.
26
+
27
+ Ubuntu 26.04 LTS is available for both providers on AMD64 and ARM64:
28
+
29
+ ```sh
30
+ empeira node run container.example.test --provider container --os ubuntu --version 26.04
31
+ empeira node run vm.example.test --provider vm --os ubuntu --version 26.04
32
+ ```
33
+
34
+ The container uses the official Ubuntu index pin in `config/defaults.yaml`; VM
35
+ images use Ubuntu's Resolute release and its HTTPS SHA-256 manifest. The configured
36
+ OpenVox Agent is available for both architectures in the
37
+ [official Ubuntu 26.04 repository](https://apt.voxpupuli.org/dists/ubuntu26.04/).
38
+ The existing APT source preservation, DNS setup, privilege and cgroup rules apply.
39
+ New Ubuntu 26.04 VMs keep the kernel's interface name and match the peer NIC by its
40
+ fixed MAC address. This avoids the upstream cloud-init/udev rename race during
41
+ restart; the static address, DNS and gateway settings stay the same. Older releases
42
+ retain their existing `eth0` naming.
43
+ Containers still default to process init; systemd init retains the documented
44
+ Podman/cgroup requirements. Ubuntu 22.04/24.04 and existing VM base revisions are
45
+ preserved; new nodes default to Ubuntu 26.04 unless configured otherwise.
46
+
26
47
  Hostname/certname is unique across both providers within a workspace. Names are
27
48
  normalized to lowercase; service names are reserved. Another checkout may reuse
28
49
  the same hostname. Before the first Puppet run, Empeira installs
@@ -107,7 +128,7 @@ on startup.
107
128
  ## Distribution package sources
108
129
 
109
130
  The reviewed Ubuntu container recipes retain the upstream distribution sources.
110
- Ubuntu 24.04 uses `/etc/apt/sources.list.d/ubuntu.sources` (deb822); older images may
131
+ Ubuntu 24.04 and 26.04 use `/etc/apt/sources.list.d/ubuntu.sources` (deb822); older images may
111
132
  use `/etc/apt/sources.list`. VM Cloud-Init leaves the base image's APT configuration
112
133
  untouched. It does not generate archive, security, ports, or internal repository
113
134
  entries.
@@ -424,7 +445,7 @@ VM. Capability detection selects KVM or HVF; software emulation is never automat
424
445
  Preflight checks commands, acceleration, image metadata, scripts, package destinations
425
446
  and control-plane readiness before downloads or node reservation.
426
447
 
427
- Ubuntu 22.04/24.04 cloud images and Rocky 8/9 GenericCloud images come directly from
448
+ Ubuntu 22.04/24.04/26.04 cloud images and Rocky 8/9 GenericCloud images come directly from
428
449
  [Ubuntu](https://cloud-images.ubuntu.com/releases/) and
429
450
  [Rocky Linux](https://dl.rockylinux.org/pub/rocky/). Availability depends on architecture.
430
451
  SHA-256 manifests are fetched over HTTPS and complete images verified before caching.
@@ -530,7 +551,7 @@ and checks the exact address and device type.
530
551
 
531
552
  | OS catalog key | Versions | Build source |
532
553
  | --- | --- | --- |
533
- | `ubuntu` | `22.04`, `24.04` | Docker Official Ubuntu images |
554
+ | `ubuntu` | `22.04`, `24.04`, `26.04` | Docker Official Ubuntu images |
534
555
  | `rocky` | `8`, `9` | Rocky Linux project images |
535
556
  | `almalinux` | `8`, `9` | Docker Official AlmaLinux images |
536
557
  | `oraclelinux` | `8` | Docker Official Oracle Linux image |
data/docs/proxy.md CHANGED
@@ -228,4 +228,6 @@ disposable helper with normal container-runtime networking and supplied user pro
228
228
  variables. Git uses the invoking user's host Git/SSH configuration and network
229
229
  access, without copying private keys. No update starts Squid, CoreDNS or other
230
230
  workspace services. See [update-plane architecture](architecture.md#runtime-and-update-planes).
231
- Self-update and the aggregate `update all` remain unavailable.
231
+ RubyGems installations support `self-update`. The aggregate `update all` first
232
+ updates Empeira, then runs image and module updates in fresh processes using the
233
+ verified installed version. A failed step stops the sequence.
@@ -321,8 +321,10 @@ diagnostics identify the affected image. Successful tool logs remain hidden.
321
321
  Update helpers are removed after completion where the engine is reachable. If an
322
322
  engine stops responding during cleanup, restore access and inspect the reported
323
323
  update-helper failure before removing anything; names alone do not establish
324
- ownership. `self-update` and `update all` remain unavailable until release package
325
- replacement is implemented. Image updates are not atomic across the full catalog;
324
+ ownership. `self-update` supports regular RubyGems installations; Git checkouts and
325
+ Bundler must use their original installation method. `update all` runs self-update,
326
+ then images and modules in fresh processes, stopping on the first failure without
327
+ rolling back earlier updates. Image updates are not atomic across the full catalog;
326
328
  earlier successful pulls/builds remain after a later failure.
327
329
 
328
330
  ## User preferences and registry authentication
@@ -3,7 +3,7 @@
3
3
  module Empeira
4
4
  module Agent
5
5
  class Target < Data.define(:os, :release, :architecture)
6
- SUITES = { '22.04' => 'jammy', '24.04' => 'noble' }.freeze
6
+ SUITES = { '22.04' => 'jammy', '24.04' => 'noble', '26.04' => 'resolute' }.freeze
7
7
  ARCHITECTURES = { 'amd64' => 'x86_64', 'arm64' => 'aarch64' }.freeze
8
8
 
9
9
  def family
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0-alpha.7",
3
- "revision": "16b913976904b1abadca0ba55d571039e762b997",
4
- "build_time": "2026-11-13T14:35:59Z"
2
+ "version": "0.1.0-alpha.8",
3
+ "revision": "f2a8c1c198ea687c438f0abafb4a65d64eb0b50d",
4
+ "build_time": "2026-11-20T12:08:29Z"
5
5
  }
@@ -95,12 +95,15 @@ module Empeira
95
95
  say 'Workspace infrastructure and persistent data removed.'
96
96
  end
97
97
 
98
- desc 'self-update', 'Update only Empeira (not implemented yet)'
98
+ desc 'self-update', 'Update Empeira to the latest stable version via RubyGems'
99
99
  def self_update
100
- Updates::Service.new.self_update
100
+ say 'Updating Empeira via RubyGems...'
101
+ previous, installed = Updates::Service.new.self_update
102
+ say(installed > previous.version ? 'Empeira updated successfully.' : 'Empeira is already up to date.')
103
+ say "Installed version: #{installed}"
101
104
  end
102
105
 
103
- desc 'update SUBCOMMAND', 'Update managed targets (not implemented yet)'
106
+ desc 'update SUBCOMMAND', 'Update Empeira and managed artifacts'
104
107
  subcommand 'update', Update
105
108
 
106
109
  %w[images].each do |operation|
@@ -7,12 +7,13 @@ module Empeira
7
7
  class Update < Base
8
8
  Updates::Service::TARGETS.each do |target|
9
9
  desc target,
10
- { 'all' => 'Update all managed targets, including Empeira (unavailable)',
10
+ { 'all' => 'Update Empeira, then images and modules using the updated installation',
11
11
  'modules' => 'Synchronize Puppetfile module artifacts',
12
12
  'images' => 'Refresh configured container image artifacts' }.fetch(target)
13
13
  define_method(target) do
14
14
  if target == 'all'
15
- application.updates.update(target)
15
+ say 'Updating Empeira, images and modules...'
16
+ Updates::Service.new.update(target)
16
17
  else
17
18
  progressing("Updating #{target}...") { |app| app.updates.update(target) }
18
19
  end
@@ -6,7 +6,7 @@ module Empeira
6
6
  NAME = /\A[a-z][a-z0-9]*(?:-[a-z0-9]+)*\z/
7
7
  RESERVED = %w[server puppetdb puppetdb-backend postgres dns coredns proxy gateway browser browser-ui vm-gateway
8
8
  bootstrap-proxy module-installer ca ssl server-data postgres-data
9
- puppetdb-data node localhost].freeze
9
+ puppetdb-data node localhost dns-validation].freeze
10
10
  FIELDS = %w[name image environment command configuration].freeze
11
11
 
12
12
  def self.validate!(entries, path)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'uri'
4
+
3
5
  module Empeira
4
6
  module Configuration
5
7
  # Node image metadata and architecture validation.
@@ -35,8 +37,13 @@ module Empeira
35
37
 
36
38
  def node_image!(image, path)
37
39
  mapping!(image, path)
38
- ImageSchema.validate!(image.except('architectures', 'build'), path)
40
+ ImageSchema.validate!(image.except('architectures', 'build', 'vm'), path)
41
+ vm_image!(image['vm'], "#{path}.vm") if image.key?('vm')
39
42
  ImageSchema.validate!({ 'build' => image['build'] }, path) if image.key?('build')
43
+ architectures!(image, path)
44
+ end
45
+
46
+ def architectures!(image, path)
40
47
  return unless image.key?('architectures')
41
48
 
42
49
  architectures = image['architectures']
@@ -51,11 +58,32 @@ module Empeira
51
58
  versions.each do |version, image|
52
59
  path = "images.nodes.#{os}.#{version}"
53
60
  required!(image, ['architectures'], path)
54
- ImageSchema.validate!(image.except('architectures', 'build'), path, effective: true)
61
+ ImageSchema.validate!(image.except('architectures', 'build', 'vm'), path, effective: true)
62
+ required!(image.fetch('vm'), %w[url checksum_url], "#{path}.vm") if image.key?('vm')
55
63
  end
56
64
  end
57
65
  end
58
66
 
67
+ def vm_image!(image, path)
68
+ mapping!(image, path)
69
+ image.each do |key, value|
70
+ next if %w[url checksum_url].include?(key) && vm_url?(value)
71
+
72
+ raise ConfigurationError, "#{path}.#{key} must be an HTTPS URL without credentials, " \
73
+ 'query strings or fragments; ' \
74
+ 'supported VM fields are url and checksum_url'
75
+ end
76
+ end
77
+
78
+ def vm_url?(value)
79
+ return false unless value.is_a?(String)
80
+
81
+ uri = URI(value.gsub('{architecture}', 'amd64'))
82
+ uri.is_a?(URI::HTTPS) && uri.host && !uri.userinfo && !uri.query && !uri.fragment
83
+ rescue URI::InvalidURIError
84
+ false
85
+ end
86
+
59
87
  def required!(data, keys, path)
60
88
  keys.each { |key| raise ConfigurationError, "#{path}.#{key} is required" unless data.key?(key) }
61
89
  end
@@ -30,7 +30,8 @@ module Empeira
30
30
  'dns' => { 'upstream' => { 'mode' => :dns_mode, 'servers' => :dns_servers },
31
31
  'additional_resolver' => :additional_resolver, 'rewrites' => :dns_rewrites },
32
32
  'node_defaults' => { 'init' => :node_init, 'os' => :optional_string, 'version' => :optional_string,
33
- 'memory' => :positive_integer, 'cpus' => :positive_integer },
33
+ 'memory' => :positive_integer, 'cpus' => :positive_integer,
34
+ 'puppet_runs' => :puppet_runs },
34
35
  'mocks' => { 'commands' => :command_mocks },
35
36
  'hiera' => { 'mounts' => :hiera_mounts },
36
37
  'eyaml' => { 'enabled' => :boolean, 'private_key' => :optional_string, 'public_key' => :optional_string },
@@ -68,6 +69,7 @@ module Empeira
68
69
  'must be an image repository'],
69
70
  image_tag: [->(v) { v.is_a?(String) && v.match?(Images::Configuration::TAG) }, 'must be an image tag'],
70
71
  node_init: [->(v) { %w[process systemd].include?(v) }, 'must be process or systemd'],
72
+ puppet_runs: [->(v) { v.is_a?(Integer) && v.between?(1, 10) }, 'must be an integer between 1 and 10'],
71
73
  dns_mode: [->(v) { %w[host explicit].include?(v) }, 'must be host or explicit'],
72
74
  dns_servers: [lambda do |v|
73
75
  v.is_a?(Array) && v.all? do |address|