blob: 1edefe514f1f39b3461085c201e90be32fc8c1bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
terraform {
required_providers {
incus = {
source = "lxc/incus"
version = "0.3.1"
}
}
}
provider "incus" {
# Configuration options
generate_client_certificates = true
accept_remote_certificate = true
remote {
name = "incus-server"
default = true
scheme = "https"
port = "8443"
address = "192.168.122.130"
token = "eyJjbGllbnRfbmFtZSI6InRvZnUiLCJmaW5nZXJwcmludCI6IjE2ZWJiYTliNTZkZDA4ZWZlNGRmMjAwZTMzYmFkMGM2ZTllNDllOWRkMzgwOGI1YTYwOTM0ODJkZDM5MjZlOWIiLCJhZGRyZXNzZXMiOlsiMTkyLjE2OC4xMjIuMTMwOjg0NDMiXSwic2VjcmV0IjoiNGY3YzhhODBlNTEwMDVhMjc4NDgzNTY1YmRlZDE1NGMzNjUwNmUxNmZjMDA0MjkwZTUwMjljNTQzZjU5NGJjOCIsImV4cGlyZXNfYXQiOiIwMDAxLTAxLTAxVDAwOjAwOjAwWiJ9"
}
}
data "template_file" "cloud-init" {
template = file("${path.module}/cloud-init.yaml")
}
resource "incus_project" "lamp" {
name = "lamp"
description = "terraform - cloud-init - ansible"
}
resource "incus_profile" "lamp" {
project = "lamp"
name = "default"
config = {
"cloud-init.user-data" = data.template_file.cloud-init.rendered
}
device {
type = "nic"
name = "eth0"
properties = {
nictype = "bridged"
parent = "br0"
}
}
device {
type = "disk"
name = "root"
properties = {
pool = "default"
path = "/"
}
}
}
|