Skip to content

Examples

ansible-pair

Two machines configured together by one Ansible playbook, the way multi-machine setups usually are: Isoloom writes the inventory (addresses, connections) and runs the playbook from a controller on the environment's network once both machines are up. VM targets only.

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

version: 1
name: ansible-pair

networks:
  lab: { cidr: 10.63.0.0/24 }

# Both machines are the same kind of box, their OS alone, said once in `common:`; the playbook
# configures them. The `pair` group sizes them together and is an inventory group too.
common:
  os: debian@12

groups:
  pair:
    members: [web, cache]
    resources: { cpus: 1, memory_mb: 1024 }

machines:
  web:
    networks: { lab: 10 }
    ports: { web: { port: 80, protocol: http } }

  cache:
    networks: { lab: 20 }
    ports: { redis: 6379 }

provision:
  - ansible: ansible/site.yml
    inventory: [ansible/groups.ini]
    requirements: ansible/requirements.yml
    groups:
      webservers: [web]
      caches: [cache]
    vars:
      greeting: hello from ansible
      # Any YAML value: lists, numbers and booleans keep their types.
      tools: [curl, jq]
      cache_port: 6379
    # Per machine, on its inventory line.
    host_vars:
      cache: { maxmemory: 64mb }

# The controller that runs the playbooks: 1 CPU, 512 MB and an Alpine box by default.
controller:
  resources: { memory_mb: 768 }

checks:
  - { script: checks/web-answers.sh, wait: 60 }   # its service may still be starting

Targets

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

Checks

The spec's own:

  • script: checks/web-answers.sh

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