IF Commons GitHub

install

Written to: 5 requirements: 4 proved, 1 partly, 0 failing, 0 with no test recorded. 0002-cloud-init-dialect FR-002, 0002-cloud-init-dialect FR-003, 0002-cloud-init-dialect FR-004, 0002-cloud-init-dialect FR-005, 0002-cloud-init-dialect FR-006

The unattended install of one machine, as Ubuntu's installer reads it: the autoinstall configuration (a #cloud-config document, JSON being valid YAML), its meta-data, the blank-disk guard that runs before any disk is touched, and the first-boot script that hands the machine to its signed repository. The secret an install needs (the hash of the administrator's password) is never in what is rendered: a placeholder stands for it, and the boot server puts it in when it serves the file. What the machine does after it first boots is the pull of the approved tip: it clones the fleet repository, runs nothing unless the tip is signed by one of the fleet's signers, and converges itself with the playbook the repository holds (the Ansible dialect's render).

import { metaData } from "./install.ts";
metaData({ hostname: "olympia" }); // "instance-id: archon-olympia\nlocal-hostname: olympia\n"

Source: commons/archon-dialect-cloud-init/src/install.ts

4 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

PASSWORD_PLACEHOLDERconst
const PASSWORD_PLACEHOLDER: "@archon:password-hash@"

What stands for the administrator's password hash in a rendered file; the boot server replaces it when it serves the file.

Imported by 15 tests of the run (14 passed, 0 failed): the library's results

DiskSpectypeno test imports it
type DiskSpec = { readonly match: "largest" | string; readonly layout: "lvm" | "direct" | "zfs" };

The disk an install writes to: the largest one, or the one at a path, with the layout of the installer.

InstallSpectypeno test imports it
type InstallSpec = { readonly hostname: string; readonly fleet: string; readonly admin: { readonly user: string; r… (980 characters)
type InstallSpec = {
  readonly hostname: string;
  readonly fleet: string;
  readonly admin: { readonly user: string; readonly realname: string; readonly sshKeys: readonly string[] };
  readonly locale: string;
  readonly keyboard: string;
  readonly timezone: string;
  readonly disk?: DiskSpec;
  /** The MAC of the network port to use; every wired port where none is given. */
  readonly mac?: string;
  /** Packages the installer adds. */
  readonly packages?: readonly string[];
  /** Where the machine's signed repository is, which branch, and the folder of the repository that holds its rendered playbook. */
  readonly repository: { readonly url: string; readonly branch: string; readonly renderPath: string };
  /** The signers the machine trusts from its first boot, as the text of an `allowed_signers` file. */
  readonly allowedSigners: string;
  /** The boot server's URL for this install, ending in a slash. */
  readonly base: string;
  readonly proxy?: string;
};

Everything the install of one machine is made from.

metaDatafunction
function metaData(spec: Pick<InstallSpec, "hostname">): string

The cloud-init meta-data.

Imported by 7 tests of the run (6 passed, 0 failed): the library's results

convergeScriptfunction
function convergeScript(spec: Pick<InstallSpec, "base" | "repository">): string

The script that converges the machine from its signed repository, run at first boot and then on a timer: it gets the repository at its branch, runs nothing unless the tip is signed by one of the signers in /etc/archon/allowed_signers, and runs the playbook the repository holds for this machine. Shell, because nothing else is on the machine yet; it needs only git, ssh-keygen and ansible-core, which first boot installs from Ubuntu's archive.

Imported by 7 tests of the run (6 passed, 0 failed): the library's results

autoinstallfunction
function autoinstall(spec: InstallSpec, passwordHash?: string): string

The autoinstall configuration of a machine, as a #cloud-config document. The password hash is the placeholder unless it is given (by the boot server, at the moment it serves the file).

Imported by 7 tests of the run (6 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.