We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consul-template v0.37.6 (358ff54)
template { destination = "local/script.sh" data = <<-EOH set -ex cmd='bash -c "source \${NOMAD_ALLOC_DIR}/creds.env; backup"' nomad alloc exec -task postgres-task "${DB_ALLOC_ID}" ${cmd} || { exit 1; }; EOH }
+ cmd='bash -c "source \${NOMAD_ALLOC_DIR}/creds.env; backup"' + nomad alloc exec -task postgres-task a4ecf71b-3a7e-5a3b-cabd-2df187852011 bash -c '"source' '\${NOMAD_ALLOC_DIR}/creds.env;' 'backup"' \${NOMAD_ALLOC_DIR}/creds.env;: -c: line 1: unexpected EOF while looking for matching `"'
The command should be:
"source" "\${NOMAD_ALLOC_DIR}/creds.env;" "backup"
"source' '\${NOMAD_ALLOC_DIR}/creds.env;' 'backup"
Also it could be
+ nomad alloc exec -task postgres-task a4ecf71b-xx bash -c 'source ${NOMAD_ALLOC_DIR}/creds.env; backup'
Notice, in the case above the string is 'source ${NOMAD_ALLOC_DIR}/creds.env; backup' For the template:
'source ${NOMAD_ALLOC_DIR}/creds.env; backup'
nomad alloc exec -task postgres-task "${db_alloc_id}" \ bash -c "source \${NOMAD_ALLOC_DIR}/creds.env; backup" || { exit 1; };
It should be the same for the case when I used $cmd.
The text was updated successfully, but these errors were encountered:
Another example from my draft:
+ cmd='bash -c '\''source ${NOMAD_ALLOC_DIR}/creds.env; backup'\''' + nomad alloc exec -task postgres-task a4ecf71b-3a7e-5a3b-cabd-2df187852011 bash -c ''\''source' '${NOMAD_ALLOC_DIR}/creds.env;' 'backup'\'''
Notice how single ' is doubled.
'
Sorry, something went wrong.
No branches or pull requests
Consul Template version
consul-template v0.37.6 (358ff54)
Configuration
Debug output
Expected behavior
The command should be:
Actual behavior
Steps to reproduce
Thoughts
Also it could be
Notice, in the case above the string is
'source ${NOMAD_ALLOC_DIR}/creds.env; backup'
For the template:
It should be the same for the case when I used $cmd.
The text was updated successfully, but these errors were encountered: