I do not want to filter that mesage, but how can tell puppet this is fine or do I need to change the exec resource.
Regards Andreas
David Schmitt
unread,
Feb 4, 2014, 12:28:26 PM2/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
puppet is telling you that it is trying to interpret the backslash-hash
(\#) sequence in the string, but has not found a useful interpretation.
I guess that you'd like to ACTUALLY have a backslash and a has in the
string, in which case you'll need to put backslash-backslash-hash (\\#)
in there as long as you're using double quotes (").
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Your exec resource has a double-quoted string.
1) You're not doing variable interpolation, so that should be a
single-quoted string (per the accepted style).
2) Puppet *happens* to allow "\#". The docs on Puppet string types and
escaping
(https://docs.puppetlabs.com/puppet/3/reference/lang_datatypes.html#double-quoted-strings)
clearly list the allowed escape sequences. As \# isn't one of them, you
should be doubling the leading "\" to escape it.
If you do keep that as a double-quoted string, you need to escape $ as well.
-Jason
Andreas Dvorak
unread,
Feb 4, 2014, 1:19:52 PM2/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi,
thank you I think I do understand it. Here is my solution exec{ '/bin/sed \'\#^/home#d\' /etc/auto_master > /tmp/sed.tmp.$$ && mv /tmp/sed.tmp.$$ /etc/auto_master' and it works