When a password used with an https file source has characters that contain special meaning to the shell, various errors can occur. For example, if the char sequence !2 exists in a password (which it happened to for mine) bash interprets that as the 2nd command in my history and interpolates that into the curl command.
Executing this will result in one of two results, depending on whether you have run at least 2 shell commands prior to executing Puppet. I've only sampled the resulting curl commands in the examples here.
[root@rpilproxy vagrant]# curl -f -L -o /tmp/myfile -u user:password!2 https://host/path/to/file
bash: !2: event not found
...or it will output the following if ls -la happened to be the 15th command in my history...
[root@rpilproxy vagrant]# curl -f -L -o /tmp/myfile -u user:password!15 https://host/path/to/file
curl -f -L -o /tmp/myfile -u user:passwordls -la https://host/path/to/file
curl: (6) Couldn't resolve host 'host' # <- this particular error isn't significant, the curl command will still attempt to run the new command with the history interpolation
I believe the solution to be simply wrapping the username:password in the curl request with single quotes.
When a password used with an https file source has characters that contain special meaning to the shell, various errors can occur. For example, if the char sequence
!2
exists in a password (which it happened to for mine) bash interprets that as the 2nd command in my history and interpolates that into thecurl
command.Sample Puppet code:
Executing this will result in one of two results, depending on whether you have run at least 2 shell commands prior to executing Puppet. I've only sampled the resulting curl commands in the examples here.
...or it will output the following if
ls -la
happened to be the 15th command in my history...I believe the solution to be simply wrapping the username:password in the curl request with single quotes.