summaryrefslogtreecommitdiff
path: root/final/main.tf
diff options
context:
space:
mode:
Diffstat (limited to 'final/main.tf')
-rw-r--r--final/main.tf47
1 files changed, 47 insertions, 0 deletions
diff --git a/final/main.tf b/final/main.tf
new file mode 100644
index 0000000..8c90bfc
--- /dev/null
+++ b/final/main.tf
@@ -0,0 +1,47 @@
+terraform {
+ required_providers {
+ incus = {
+ source = "lxc/incus"
+ version = "0.3.1"
+ }
+ }
+}
+
+provider "incus" {
+ # Configuration options
+}
+
+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 = "/"
+ }
+ }
+}
+
+