0

Using https://github.com/concourse/concourse:latest (4.2.2).

When I have a concourse-ci pipeline document I can use variables like ((var)) and {{var}} - however how do I pass in a file with variables such as

params:
  kubectl: | k8s/mykubectl # a template file that has variables

And then this file has contents such as:

run test --image=testme:((mytag)) --port ((myport))

How do I get concourse to replace those variables like for example the ansible template module will do..

Thanks for any suggestions!

Bob
  • 31
  • 1

2 Answers2

1

I found an answer to this using https://github.com/kelseyhightower/confd.

Basically built a docker image based on alpine with the confd binary in its PATH. Then use that image as a task resource to generate a file based on a template and some source of KVPS. With confd for your KVPs you can use consul, vault etc I used a .yml file that works just as well.

Hope that helps!!

Bob
  • 31
  • 1
0

I don't know Concourse-CI, so I'm not sure that I understood your question correctly. Nevertheless, if your question is: How in can I ensure that the Ansible will not interpret some part of a template file? I would suggest you the raw tag to escape a template block.

{% raw %}
run test --image=testme:((mytag)) --port ((myport))
{% endraw %}

Ref: Escape jinja2 syntax in a jinja2 template

xenlo
  • 761
  • 1
  • 7
  • 21