MatthiasScholz / cos

Basic Cluster Orchestration Setup
GNU Lesser General Public License v3.0
34 stars 11 forks source link

Provide possibility to inject userdata #22

Open ThomasObenaus opened 6 years ago

ThomasObenaus commented 6 years ago

Some use-cases (i.e. mounting an efs mount-target) are best implemented via user-data when the instance is created. With the current module api it is not possible to add steps to the user-data of the nomad nodes.

It would be nice to have this option.

MatthiasScholz commented 5 years ago

Terraform support the functionality to render a cloud-init-script from separate parts: https://www.terraform.io/docs/providers/template/d/cloudinit_config.html

Render a multi-part cloud-init config making use of the part

above, and other source files

data "template_cloudinit_config" "config" { gzip = true base64_encode = true

Main COS configuration file.

part { filename = "init.cfg" content_type = "text/cloud-config" content = "${data.template_file.script.rendered}" }

User provided configuration file.

part { content_type = "text/x-shellscript" content = "${var.user-specific-user-data}" } }

MatthiasScholz commented 5 years ago

Things to change in this repository: https://github.com/MatthiasScholz/cos/blob/d6263fdebbb3685d9a8d9aeff5b649408cc217f3/modules/nomad-datacenter/datacenter.tf