Compare commits
1 Commits
f2b4e6f80e
...
119997e273
| Author | SHA1 | Date | |
|---|---|---|---|
| 119997e273 |
13
.drone.yml
13
.drone.yml
@@ -6,6 +6,8 @@ name: Terraform root module
|
|||||||
environment:
|
environment:
|
||||||
TF_IN_AUTOMATION: "1"
|
TF_IN_AUTOMATION: "1"
|
||||||
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no -i $${PWD}/id_rsa"
|
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no -i $${PWD}/id_rsa"
|
||||||
|
TF_VAR_lawndale_libvirt_uri_transport: ssh
|
||||||
|
TF_VAR_lawndale_libvirt_uri_userhostport: "192.168.253.254:10022"
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
ref:
|
ref:
|
||||||
@@ -18,6 +20,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- echo "$${CI_SSH_KEY}" | base64 -d > id_rsa
|
- echo "$${CI_SSH_KEY}" | base64 -d > id_rsa
|
||||||
- chmod 600 id_rsa
|
- chmod 600 id_rsa
|
||||||
|
- echo 'lawndale_libvirt_uri_extra = {"sshauth"="privkey","keyfile"="'$${PWD}'/id_rsa","no_verify"="1"}' >> ci.tfvars
|
||||||
- terraform init
|
- terraform init
|
||||||
environment:
|
environment:
|
||||||
CI_SSH_KEY:
|
CI_SSH_KEY:
|
||||||
@@ -30,9 +33,7 @@ steps:
|
|||||||
- name: terraform plan
|
- name: terraform plan
|
||||||
image: hashicorp/terraform:1.1.8
|
image: hashicorp/terraform:1.1.8
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p ~/.ssh
|
- terraform plan -var-file ci.tfvars -out .tfplan
|
||||||
- cp -a id_rsa ~/.ssh/id_rsa
|
|
||||||
- terraform plan -out .tfplan
|
|
||||||
environment:
|
environment:
|
||||||
AWS_ACCESS_KEY_ID:
|
AWS_ACCESS_KEY_ID:
|
||||||
from_secret: terraform-aws-key-id
|
from_secret: terraform-aws-key-id
|
||||||
@@ -53,9 +54,7 @@ steps:
|
|||||||
- push
|
- push
|
||||||
image: hashicorp/terraform:1.1.8
|
image: hashicorp/terraform:1.1.8
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p ~/.ssh
|
- terraform apply -var-file ci.tfvars .tfplan
|
||||||
- cp -a id_rsa ~/.ssh/id_rsa
|
|
||||||
- terraform apply .tfplan
|
|
||||||
environment:
|
environment:
|
||||||
AWS_ACCESS_KEY_ID:
|
AWS_ACCESS_KEY_ID:
|
||||||
from_secret: terraform-aws-key-id
|
from_secret: terraform-aws-key-id
|
||||||
@@ -70,6 +69,6 @@ steps:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 698805937fd548b8265f65322cb6e9cd83689faeba99d3387ffb255701d53f5e
|
hmac: 007cc7fc0dbdc2ae54a59dbc6c673e33e4f94831189eb3b6fd4b0b0f8adf703f
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -38,4 +38,13 @@ EehXHhbRmbtSZ7c4DrGeR2J0SZTyBQJfZczSGRvEiKyGNnyZlLVYKTTnV9b+aN3q
|
|||||||
Xw+ilWL3boYsSiqVN6SIUA==
|
Xw+ilWL3boYsSiqVN6SIUA==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
EOM
|
EOM
|
||||||
|
|
||||||
|
|
||||||
|
lawndale_libvirt_uri_extra = join("&", [for k, v in var.lawndale_libvirt_uri_extra : format("%s=%s", urlencode(k), urlencode(v))])
|
||||||
|
lawndale_libvirt_uri = var.lawndale_libvirt_uri != null ? var.lawndale_libvirt_uri : format("qemu+%s://%s%s?%s",
|
||||||
|
var.lawndale_libvirt_uri_transport,
|
||||||
|
var.lawndale_libvirt_uri_userhostport,
|
||||||
|
var.lawndale_libvirt_uri_path,
|
||||||
|
local.lawndale_libvirt_uri_extra
|
||||||
|
)
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ provider "aws" {
|
|||||||
|
|
||||||
provider "libvirt" {
|
provider "libvirt" {
|
||||||
# no-pty ssh-rsa AAAAB3.....
|
# no-pty ssh-rsa AAAAB3.....
|
||||||
uri = "qemu+ssh://lawndale-hyper.sch.bme.hu:10022/system?sshauth=privkey"
|
uri = local.lawndale_libvirt_uri
|
||||||
}
|
}
|
||||||
|
|
||||||
provider "dns" {
|
provider "dns" {
|
||||||
|
|||||||
30
variables.tf
30
variables.tf
@@ -32,3 +32,33 @@ variable "lawndale_dns_key_algorithm" {
|
|||||||
description = "DNSSEC key to use sigining the NSUPDATE queries for Lawndale"
|
description = "DNSSEC key to use sigining the NSUPDATE queries for Lawndale"
|
||||||
default = "hmac-sha256"
|
default = "hmac-sha256"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "lawndale_libvirt_uri" {
|
||||||
|
type = string
|
||||||
|
description = "Libvirt URI to use accessing Lawndale hypervisor"
|
||||||
|
default = null
|
||||||
|
nullable = true
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "lawndale_libvirt_uri_transport" {
|
||||||
|
type = string
|
||||||
|
description = "Transport protocol (could be ssh or tls) to dial Lawndale hypervisor"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "lawndale_libvirt_uri_userhostport" {
|
||||||
|
type = string
|
||||||
|
description = "Libvirt URI username, hostname or ip address, and port to reach lawndale hypervisor, in the format of `[username@]<hostname>[:port]`"
|
||||||
|
default = "lawndale-hyper"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "lawndale_libvirt_uri_path" {
|
||||||
|
type = string
|
||||||
|
description = "Libvirt URI path sent to the libvirt daemon"
|
||||||
|
default = "/system"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "lawndale_libvirt_uri_extra" {
|
||||||
|
type = map(any)
|
||||||
|
description = "Libvirt URI extra parameters [https://libvirt.org/uri.html#transport-configuration](See Libvirt transport configuration)"
|
||||||
|
default = {}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user