Skip to content

Provision staging vms through terraform (up to the first puppet run)

It's done in multiple steps:

  • (once) preparing your workstation to orchestrate the terraform tooling (for proxmox here)
  • (once) first create a template (through the hypervisor though, it's scripted in this diff)
  • (n times vm) defines vm through the proxmox dsl in staging.tf file (there are 2 here: gateway, storage0)

The current staging.tf file defines 2 that can be created from scratch (run terraform destroy, terraform apply, also clean up the puppet master's certificates for those node):

  • gateway (192.168.128.1)
  • storage0 (192.168.128.2). Routing its packets through the gateway (as a storage server node)

This diff also defines a series of documents (markdown, scripts) to clarify how to:

  • prepare the workstation with the tools
  • create the template vm (debian 9/10)

Note: This works for debian oldstable (9) and stable (10).

Requisite (for reproducibility):

  • swh-site: Needs to be updated to add the expected roles for the new vms (branch new_staging)
  • pergamon:/etc/puppet/autosign.conf: Updated manually the file to add the new domain internal.staging.swh.network (i don't see any puppet stanza which deals with that yet)
  • louvre: one route has been added to louvre to allow the ssh connection from the internal network ssh root@192.168.128.1 (gateway access).

Related T1785

Test Plan

terraform init
terraform apply

...

Run from scratch (no manual intervention):

proxmox_vm_qemu.gateway (remote-exec): Notice: Applied catalog in 202.40 seconds
proxmox_vm_qemu.gateway (remote-exec): Node provisionned!
...
proxmox_vm_qemu.storage (remote-exec): Notice: Applied catalog in 229.62 seconds
proxmox_vm_qemu.storage: Still creating... (6m10s elapsed)
proxmox_vm_qemu.storage (remote-exec): Node provisionned!
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Check connectivity:

$ ssh ardumont@192.168.128.1 'echo hello from $(hostname)'
hello from gateway
$ ssh ardumont@192.168.128.2 'echo hello from $(hostname)'
hello from storage0

Migrated from D1762 (view on Phabricator)

Merge request reports