--- # Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 # (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in # .gitea/workflows/molecule.yml. The containers stand in for the guest: the role's input # validation and its drift detection over a seeded VM config run against them. Nothing calls the # Proxmox API (README, Tests). The containers run systemd as PID 1 with a writable cgroup; no # privileged mode. driver: name: docker platforms: - name: ${KAMINO_RUN_ID:-local}-pve-vm-instance labels: net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}" image: ${MOLECULE_IMAGE} pre_build_image: true pull: true command: /sbin/init cgroupns_mode: host volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw tmpfs: - /run - /run/lock security_opts: - apparmor=unconfined - name: ${KAMINO_RUN_ID:-local}-pve-vm-2604-instance labels: net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}" image: ${MOLECULE_IMAGE_2604} pre_build_image: true pull: true command: /sbin/init cgroupns_mode: host volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw tmpfs: - /run - /run/lock security_opts: - apparmor=unconfined provisioner: name: ansible # One source for every play, so the converge, the drift cases and the negative tests in # verify.yml start from the same valid input, which matches the seeded VM config of converge.yml. inventory: group_vars: all: pve_vm_node: pve-node pve_vm_vmid: 9200 # The node is not an inventory host, from which the role defaults the API address; # argument validation templates that default, so main would fail on it instead. pve_vm_api_host: 192.0.2.1 pve_vm_api_user: molecule pve_vm_api_token_secret: not-a-secret # pve_vm_disk_size is set where a case needs it, so the refusal case can leave it undefined. pve_vm_state: started pve_vm_memory: 2048 pve_vm_cores: 2 pve_vm_sockets: 1 pve_vm_ci_user: ubuntu pve_vm_sshkeys: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMoleculeTestKeyNotARealKey molecule pve_vm_network: net0: model: virtio bridge: vmbr0 tag: 20 firewall: true pve_vm_ipconfig: ipconfig0: ip=192.0.2.30/24,gw=192.0.2.1 pve_vm_nameservers: - 192.0.2.53 - 198.51.100.53 # The live config the REST lookup would return, in Proxmox's own forms: agent with flags, # ipconfig0 tokens reordered, sshkeys URL-encoded, nameservers space-separated. pve_vm_test_config: name: "{{ inventory_hostname | lower | replace('_', '-') }}" cpu: host memory: 2048 cores: 2 sockets: 1 ciuser: ubuntu sshkeys: ssh-ed25519%20AAAAC3NzaC1lZDI1NTE5AAAAIMoleculeTestKeyNotARealKey%20molecule%0A ipconfig0: gw=192.0.2.1,ip=192.0.2.30/24 nameserver: 192.0.2.53 198.51.100.53 onboot: 1 agent: fstrim_cloned_disks=1,enabled=1 net0: virtio=BC:24:11:00:00:01,bridge=vmbr0,firewall=1,tag=20 scsi0: local-lvm:vm-9200-disk-0,size=32G verifier: name: ansible scenario: # molecule's default sequence minus both destroys (scripts/run_molecule_scenarios.sh removes the # containers as soon as this scenario ends; after a local run, run `molecule destroy` yourself), # plus a check before the converge (fresh host) and one after it (converged host). test_sequence: - dependency - cleanup - syntax - create - prepare - check - converge - check - idempotence - side_effect - verify - cleanup