diff --git a/README.md b/README.md index 341b6a6..ba9a564 100644 --- a/README.md +++ b/README.md @@ -204,9 +204,7 @@ You can check the status of the certificate in the Google Cloud Console. ## Modules -| Name | Source | Version | -|------|--------|---------| -| [container](#module\_container) | terraform-google-modules/container-vm/google | ~> 3.2 | +No modules. ## Resources @@ -234,9 +232,9 @@ You can check the status of the certificate in the Google Cloud Console. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [args](#input\_args) | Arguments to override the container image default command (CMD). | `list(string)` | `null` | no | +| [args](#input\_args) | Arguments to override the container image default command (CMD). | `list(string)` | `[]` | no | | [block\_project\_ssh\_keys\_enabled](#input\_block\_project\_ssh\_keys\_enabled) | Blocks the use of project-wide publich SSH keys | `bool` | `false` | no | -| [command](#input\_command) | Command to override the container image ENTRYPOINT | `list(string)` | `null` | no | +| [command](#input\_command) | Command to override the container image ENTRYPOINT | `list(string)` | `[]` | no | | [default\_backend\_security\_policy](#input\_default\_backend\_security\_policy) | Name of the security policy to apply to the default backend service | `string` | `null` | no | | [disk\_kms\_key\_self\_link](#input\_disk\_kms\_key\_self\_link) | The self link of the encryption key that is stored in Google Cloud KMS | `string` | `null` | no | | [domain](#input\_domain) | Domain to associate Atlantis with and to request a managed SSL certificate for. Without `https://` | `string` | n/a | yes | diff --git a/main.tf b/main.tf index 0b9e5bc..cc73570 100644 --- a/main.tf +++ b/main.tf @@ -8,10 +8,11 @@ locals { atlantis_network_traffic_tags = ["atlantis-${random_string.random.result}"] atlantis_labels = merge( var.labels, - module.container.container_vm.labels, - { "vm" = module.container.container_vm.name }, { "app" = "atlantis" } ) + atlantis_persistent_disk_name = "atlantis-disk-0" + atlantis_disk_mount_path = "/mnt/disks/gce-containers-mounts/gce-persistent-disks/${local.atlantis_persistent_disk_name}" + atlantis_uid = 100 } resource "random_string" "random" { @@ -38,7 +39,20 @@ data "cloudinit_config" "config" { base64_encode = false part { - filename = "atlantis-chown-disk.service" + filename = "runcmda" + content_type = "text/cloud-config" + merge_type = "list(append)+dict(no_replace, recurse_list)+str()" + content = yamlencode({ + runcmd = [ + "systemctl daemon-reload", + "systemctl start --no-block atlantis-chown-disk.service", + "systemctl start --no-block atlantis.service" + ] + }) + } + + part { + filename = "services" content_type = "text/cloud-config" content = yamlencode({ write_files = [ @@ -49,10 +63,32 @@ data "cloudinit_config" "config" { content = <