diff --git a/.github/workflows/stackhpc-all-in-one.yml b/.github/workflows/stackhpc-all-in-one.yml index 1d2027a3e..d83630af1 100644 --- a/.github/workflows/stackhpc-all-in-one.yml +++ b/.github/workflows/stackhpc-all-in-one.yml @@ -90,6 +90,7 @@ jobs: run: | cat << EOF > terraform.tfvars ssh_public_key = "id_rsa.pub" + ssh_username = "${{ env.SSH_USERNAME }}" aio_vm_interface = "${{ env.VM_INTERFACE }}" aio_vm_name = "${{ env.VM_NAME }}" aio_vm_image = "${{ env.VM_IMAGE }}" @@ -99,6 +100,7 @@ jobs: EOF working-directory: ${{ github.workspace }}/terraform/aio env: + SSH_USERNAME: "${{ inputs.os_distribution == 'ubuntu' && 'ubuntu' || 'cloud-user' }}" VM_NAME: "skc-ci-aio-${{ inputs.neutron_plugin }}-${{ github.run_id }}" VM_IMAGE: ${{ inputs.vm_image }} VM_FLAVOR: ${{ inputs.vm_flavor }} diff --git a/.github/workflows/stackhpc-pull-request.yml b/.github/workflows/stackhpc-pull-request.yml index c38f9adf0..49f5cb6b6 100644 --- a/.github/workflows/stackhpc-pull-request.yml +++ b/.github/workflows/stackhpc-pull-request.yml @@ -92,3 +92,31 @@ jobs: OS_CLOUD: sms-lab-release secrets: inherit if: github.repository == 'stackhpc/stackhpc-kayobe-config' + + all-in-one-ubuntu-ovs: + name: aio (Ubuntu OVS) + needs: + - build-kayobe-image + uses: ./.github/workflows/stackhpc-all-in-one.yml + with: + kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }} + os_distribution: ubuntu + neutron_plugin: ovs + vm_image: Ubuntu-20.04 + OS_CLOUD: sms-lab-release + secrets: inherit + if: github.repository == 'stackhpc/stackhpc-kayobe-config' + + all-in-one-ubuntu-ovn: + name: aio (Ubuntu OVN) + needs: + - build-kayobe-image + uses: ./.github/workflows/stackhpc-all-in-one.yml + with: + kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }} + os_distribution: ubuntu + neutron_plugin: ovn + vm_image: Ubuntu-20.04 + OS_CLOUD: sms-lab-release + secrets: inherit + if: github.repository == 'stackhpc/stackhpc-kayobe-config' diff --git a/terraform/aio/templates/userdata.cfg.tpl b/terraform/aio/templates/userdata.cfg.tpl index 9cae72983..aebd19229 100644 --- a/terraform/aio/templates/userdata.cfg.tpl +++ b/terraform/aio/templates/userdata.cfg.tpl @@ -9,7 +9,7 @@ runcmd: # Configure SSH keys here, to avoid creating an ephemeral keypair. # This means only the instance needs to be cleaned up if the destroy fails. ssh_authorized_keys: - - ${ssh_public_key} + - ${ssh_public_key} write_files: # WORKAROUND: https://bugs.launchpad.net/kolla-ansible/+bug/1995409 diff --git a/terraform/aio/vm.tf b/terraform/aio/vm.tf index 911b0a5a3..bf881e5cc 100644 --- a/terraform/aio/vm.tf +++ b/terraform/aio/vm.tf @@ -2,6 +2,10 @@ variable "ssh_public_key" { type = string } +variable "ssh_username" { + type = string +} + variable "aio_vm_name" { type = string default = "kayobe-aio" @@ -55,5 +59,17 @@ resource "openstack_compute_instance_v2" "kayobe-aio" { destination_type = "volume" delete_on_termination = true } +} + +# Wait for the instance to be accessible via SSH before progressing. +resource "null_resource" "kayobe-aio" { + provisioner "remote-exec" { + connection { + host = openstack_compute_instance_v2.kayobe-aio.access_ip_v4 + user = var.ssh_username + private_key = file("id_rsa") + } + inline = ["echo 'connected!'"] + } }