From a707d09f92ee4d62d10229d640b18caed025e0c6 Mon Sep 17 00:00:00 2001 From: Krystian Panek Date: Tue, 7 Nov 2023 10:00:37 +0100 Subject: [PATCH] System service PoC --- README.md | 2 +- examples/ssh/aem.tf | 21 ++--- go.mod | 1 - .../provider/instance/config.yml | 0 internal/provider/instance/embed.go | 9 +++ internal/provider/instance/plan_modifiers.go | 42 ---------- .../provider/instance/systemd.conf.go.tpl | 19 +++++ internal/provider/instance_resource.go | 77 ++++++++----------- internal/utils/template.go | 18 +++++ 9 files changed, 91 insertions(+), 98 deletions(-) rename examples/ssh/aem/default/etc/aem.yml => internal/provider/instance/config.yml (100%) create mode 100644 internal/provider/instance/embed.go delete mode 100644 internal/provider/instance/plan_modifiers.go create mode 100644 internal/provider/instance/systemd.conf.go.tpl create mode 100644 internal/utils/template.go diff --git a/README.md b/README.md index 115db73..39ee840 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Built on top of [AEM Compose](https://github.com/wttech/aemc). ```hcl resource "aem_instance" "single" { - depends_on = [aws_instance.aem_single, aws_volume_attachment.aem_single_data] + depends_on = [aws_instance.aem_single, aws_volume_attachment.aem_single_data]ยง client { type = "ssh" diff --git a/examples/ssh/aem.tf b/examples/ssh/aem.tf index ceb35bb..fcb7b3c 100644 --- a/examples/ssh/aem.tf +++ b/examples/ssh/aem.tf @@ -10,12 +10,14 @@ resource "aem_instance" "single" { private_key_file = local.ssh_private_key # cannot be put into state as this is OS-dependent } } - compose { - version = "1.5.8" - data_dir = local.aem_single_compose_dir + /* TODO support this as well + files = { + "lib" = "${local.aem_single_compose_dir}/aem/home/lib" } - hook { - bootstrap = <