While having a consul template is useful, there is one thing to keep in mind, for example: the script that will be run after checking for any changes to the consul service discovery, should be located in a different folder; otherwise it will throw the following error.
root@server-dc-01:/etc/consul-template.d# /usr/local/bin/consul-template -config=/etc/consul-template.d
2022/10/20 15:44:27 [ERR] (cli) walk error: from file: /etc/consul-template.d/lala: error decoding config: At 2:1: key ‘echo “h
ola”’ expected start of object (‘{‘) or assignment (‘=’)
debug:
/usr/local/bin/consul-template -config=/etc/consul-template.d
Note:
- Move the script out of the consul-template.d directory and might be fixed.