2022-07-28 20:52:07 -03:00
|
|
|
terraform {
|
|
|
|
required_providers {
|
|
|
|
lxd = {
|
|
|
|
source = "terraform-lxd/lxd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
provider "lxd" {
|
|
|
|
generate_client_certificates = true
|
|
|
|
accept_remote_certificate = true
|
|
|
|
}
|
|
|
|
|
2022-08-05 01:34:36 -03:00
|
|
|
resource "lxd_cached_image" "image" {
|
2022-07-28 20:52:07 -03:00
|
|
|
source_remote = "ubuntu"
|
|
|
|
source_image = "focal/amd64"
|
|
|
|
}
|
2022-08-05 01:34:36 -03:00
|
|
|
resource "lxd_container" "container1" {
|
2022-09-15 00:18:11 -03:00
|
|
|
name = "OpenLDAP-test"
|
2022-08-05 01:34:36 -03:00
|
|
|
image = lxd_cached_image.image.fingerprint
|
2022-07-28 20:52:07 -03:00
|
|
|
ephemeral = false
|
|
|
|
limits = {
|
2022-09-15 00:18:11 -03:00
|
|
|
cpu = 1
|
2022-07-28 20:52:07 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-15 00:18:11 -03:00
|
|
|
output "container_ip_address" {
|
|
|
|
value = lxd_container.container1.ip_address
|
|
|
|
}
|
|
|
|
|
|
|
|
output "container_name" {
|
|
|
|
value = lxd_container.container1.name
|
|
|
|
}
|