With the assumption that Consul and Nomad has been configured to run on a pool of resource. How would you rendered a template file for the sole purpose of generating e.g. an Nginx 'default.conf' file.
Using the template stanza configuration below, as an example; Nomad fails to generate a default.conf 'file'; instead a default.conf 'directory' is created.
template {
source = "/path/to/tmp.ctmpl"
destination = "folder/default.conf"
change_mode = "restart"
change_signal = "SIGINT"
}
I'm either missing a trick, or have misunderstood the functionalities of the 'template stanza'.
One of the issue with the template generating a directory rather than a file is, you cannot mount a directory to a config file path. So running a task that uses the Nomad docker driver with the exemplar 'docker' volume config results in an error.
volumes = ["/path/to/job/folder/default.conf:/etc/nginx/conf.d/default.conf" ]
Or is it impossible to have the template stanza generate a config file?
*P.s. Using Nomad build 0.5.5**