cloudinit.tf 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. data "template_file" "cloud-init" {
  2. # Should these be in a common directory? I suspect they'd be reusable
  3. template = file("${path.module}/cloud-init/cloud-init.tpl")
  4. vars = {
  5. prefix = var.prefix
  6. zone = var.dns_info["private"]["zone"]
  7. environment = var.environment
  8. salt_master = var.salt_master
  9. proxy = var.proxy
  10. aws_partition = var.aws_partition
  11. aws_partition_alias = var.aws_partition_alias
  12. }
  13. }
  14. # Render a multi-part cloud-init config making use of the part
  15. # above, and other source files
  16. data "template_cloudinit_config" "cloud-init" {
  17. gzip = true
  18. base64_encode = true
  19. # Main cloud-config configuration file.
  20. part {
  21. filename = "init.cfg"
  22. content_type = "text/cloud-config"
  23. content = data.template_file.cloud-init.rendered
  24. }
  25. part {
  26. content_type = "text/cloud-boothook"
  27. content = file("${path.module}/cloud-init/nvme-setup.sh")
  28. }
  29. part {
  30. content_type = "text/cloud-boothook"
  31. content = file("${path.module}/cloud-init/opt_splunk.boothook")
  32. }
  33. }