I'm using a script to collect build spec information from the user, then using knife to clone and build a VM to spec. CHEF then copies some shell scripts to the provisioned node, then I execute those scripts using "knife ssh".
This works fine:
template '/path/to/filename.sh' do
source 'filename.sh.erb'
mode 755
end
This doesn't:
cookbook_file '/path/to/filename.sh' do
source 'filename.sh'
mode 755
end
The contents of the filename.sh.erb and filename.sh are identical. The error message I get is as follows:
DEMO-CCM2.t3fca.com bash: /tmp/C3_Component_Install.sh: /bin/bash^M: bad interpreter: No such file or directory
The very top of both files looks like this:
#!/bin/bash
If I go to the host and try to run the script manually, all of the following work just fine:
- sh C3_Component_Install.sh
- /bin/bash C3_Component_Install.sh
- /usr/bin/bash C3_Component_Install.sh
- /tmp/C3_Component_Install.sh
So I don't know what's wrong. Thanks in advance for any help.