Skip to content

Examples

several-addresses

Several addresses on one network: a machine written office: [10, 11, 12] has .10 (its primary address, the one its name resolves to) and .11 and .12 besides, on the same interface. A web server with a site per address, and a host that answers on a whole /28 (a block of addresses in use, as a load-balancer pool or a NAT range takes one). Each VM's set-up adds the further addresses; a cloud learns them too (AWS secondary private addresses and an IPv4 prefix for the /28, Azure IP configurations, Google Cloud alias ranges, Oracle Cloud secondary private IPs, Linode routed ranges). Every hosts file names them after their machine, and the derived checks probe each one. The machines' steps install and configure only, so they build each machine's container form too.

The example's folder, with the files its spec names: examples/several-addresses.

version: 1
name: several-addresses

networks:
  office: { cidr: 10.86.0.0/24 }

machines:
  # A site per address: nginx answers on all three.
  web:
    os: debian@12
    networks: { office: [10, 11, 12] }
    ports: { web: { port: 80, protocol: http } }
    app:
      steps: [{ run: provision/web.sh }]
  # A host at .40 that also answers on the whole of 10.86.0.48/28.
  block:
    os: debian@12
    networks: { office: [40, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] }
    app:
      steps: [{ run: provision/block.sh }]
  client:
    os: debian@12
    networks: { office: 20 }
    app:
      steps: [{ run: provision/client.sh }]

checks:
  - name: the second site answers at its own address
    from: client
    http: http://10.86.0.12/
  - name: the hosts file names the web server's further address
    from: client
    exec: getent hosts 10.86.0.11
    expect: web
  - name: the block host answers on its /28
    from: client
    exec: ping -c 1 -W 2 10.86.0.57

Targets

vagrant, proxmox, esxi, cloud-vm. See targets for what each means.

Checks

The spec's own:

  • the second site answers at its own address (http)
  • the hosts file names the web server's further address (exec)
  • the block host answers on its /28 (exec)

Plus the checks Isoloom derives from the machines' ports and the reach rules. See checks.