My hiera entries parse incorrectly

79 views
Skip to first unread message

Marc Whittaker

unread,
Jul 4, 2014, 1:11:49 PM7/4/14
to puppet...@googlegroups.com
Hi Everyone,

I have run into an issue using puppet with hiera. The situation is I have the following in a yaml file

- marcstest1.password='Checking\: This'

When I try to fill this into a file using a template similar to below this is what gets put into the file instead

# General Settings
<% props.each do |prop| -%>
<%= prop %>
<% end -%>

marcstest1.password='Checking\This'

when the expected result is marcstest1.password='Checking: This'

Can anyone tell me what I am doing wrong?

Marc Whittaker

unread,
Jul 4, 2014, 1:50:55 PM7/4/14
to puppet...@googlegroups.com
I am using puppet 2.7

Rich Burroughs

unread,
Jul 4, 2014, 2:28:09 PM7/4/14
to puppet...@googlegroups.com
Hi Marc,

Have you tried removing that backslash? I don't think you need to escape the colon.


Rich 
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b08b25d5-621f-467c-96a2-92a2cf9231e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc Whittaker

unread,
Jul 4, 2014, 2:45:40 PM7/4/14
to puppet...@googlegroups.com
Actually if I remove the backslash the result is instead

marcstest1.password='CheckingThis'


and if I shift the backslash to after the colon I get 

marcstest1.password='Checking:\ This'


On Friday, 4 July 2014 14:28:09 UTC-4, Rich Burroughs wrote:
Hi Marc,

Have you tried removing that backslash? I don't think you need to escape the colon.


Rich 

On Friday, July 4, 2014, Marc Whittaker <marcwh...@gmail.com> wrote:
Hi Everyone,

I have run into an issue using puppet with hiera. The situation is I have the following in a yaml file

- marcstest1.password='Checking\: This'

When I try to fill this into a file using a template similar to below this is what gets put into the file instead

# General Settings
<% props.each do |prop| -%>
<%= prop %>
<% end -%>

marcstest1.password='Checking\This'

when the expected result is marcstest1.password='Checking: This'

Can anyone tell me what I am doing wrong?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.

Rich Burroughs

unread,
Jul 4, 2014, 3:37:49 PM7/4/14
to puppet...@googlegroups.com
Ah ok. I was looking at this page:


Which is linked here:


It seems to indicate that you don't need to escape colons in single quoted strings but maybe I'm misreading it.

I don't think I've ever had a colon in my data. You might try double quotes too if you haven't. Or maybe someone who knows for sure will pipe in :)


To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/fddcac35-1bc7-474d-b892-8450e2201e6d%40googlegroups.com.

Marc Whittaker

unread,
Jul 7, 2014, 10:18:07 AM7/7/14
to puppet...@googlegroups.com
Thanks for the suggestions Rich.

I did try double quotes and the result if the same so still no progress.

Hoping someone out there has a colon in their data and can point me in the right direction.

jcbollinger

unread,
Jul 7, 2014, 11:17:26 AM7/7/14
to puppet...@googlegroups.com


On Monday, July 7, 2014 9:18:07 AM UTC-5, Marc Whittaker wrote:
Thanks for the suggestions Rich.

I did try double quotes and the result if the same so still no progress.



Yours is neither a single-quoted nor a double-quoted value.  It is an unquoted value with a single quotes somewhere in the middle and at the end.  In other words, the quotes are part of the data (which is apparently intentional), not significant to the language syntax.  I think this would work:

- "marcstest1.password='Checking: This'"


John

Marc Whittaker

unread,
Jul 7, 2014, 3:18:22 PM7/7/14
to puppet...@googlegroups.com
Thank you so much John,

As soon I read your comment the light went on.......
Reply all
Reply to author
Forward
0 new messages