Templating a shell script - major error

707 views
Skip to first unread message

Axel Bock

unread,
Jan 17, 2013, 4:54:23 AM1/17/13
to puppet...@googlegroups.com
Hi group,

I am trying to template a bash script with puppet. Unfortunately, this fails with a bang, and even more unfortunately I have no idea why.

The script starts with the usual

#!/bin/bash

When I run puppet, I get this:

info: Caching catalog for l1211022.sdst.sbaintern.de
err: Failed to apply catalog: Parameter source failed: Could not understand source #!/bin/bash

[... complete script dump ...]


... in neon pink. I tried encapsulating it in <%= "#!/bin/bash" %>, or even in <%= "!" %><%= "#/bin/bash" %>, but no use. I think I am triggering some ERB-internal thing here, but I could not find anything in the docs, and I am kind of lost here.


Can anyone help?
Thanks in advance & greetings,
Axel.

Dominic Cleal

unread,
Jan 17, 2013, 4:59:33 AM1/17/13
to puppet...@googlegroups.com
On 17/01/13 09:54, Axel Bock wrote:
> Hi group,
>
> I am trying to template a bash script with puppet. Unfortunately, this
> fails with a bang, and even more unfortunately I have no idea why.
>
> The script starts with the usual
>
> #!/bin/bash
>
> When I run puppet, I get this:
>
> info: Caching catalog for l1211022.sdst.sbaintern.de
> err: Failed to apply catalog: Parameter source failed: Could not
^^^^^^
> understand source #!/bin/bash

Looks like you're using the template() function with the source
parameter when it should be content => template(...). Puppet is trying
to parse the shell script as a source URL.

--
Dominic Cleal
Red Hat Engineering

Axel Bock

unread,
Jan 17, 2013, 4:59:44 AM1/17/13
to puppet...@googlegroups.com
oops. forget everything. my mistake. stupid one. and of course this _can_ only be discovered after you posted a stupid question to really document your own idiocy.
:)

Thanks,
Axel.

Axel Bock

unread,
Jan 17, 2013, 5:14:18 AM1/17/13
to puppet...@googlegroups.com, dcl...@redhat.com
yes, found it already (see my last messge).

sorry for wasting your lifetime ;)

Dan White

unread,
Jan 17, 2013, 7:57:27 AM1/17/13
to puppet...@googlegroups.com
Don't feel bad, Axel.
You learned from this goof.

The stooopid question is the one you do NOT ask.  Then you suffer in silent ignorance.

Ignorance can be fixed.  Stupidity ....?

“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)


From: "Dominic Cleal" <dcl...@redhat.com>
To: puppet...@googlegroups.com
Sent: Thursday, January 17, 2013 4:59:33 AM
Subject: Re: [Puppet Users] Templating a shell script - major error
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Reply all
Reply to author
Forward
0 new messages