Ask Your Question
0

prevent interpolation with file_line and hiera

asked 2015-12-10 18:07:28 -0500

lclegg gravatar image

updated 2015-12-10 18:08:51 -0500

I am using file_line to add a line to my sudoers file. The line I need to add includes a "%{user}" which I need to be quoted literally.

If I use file_line from my site.pp it works great...the line is passed with single quotes and interpolation does not occur.

However, when I use file_line within a Hiera construct the "%{user}" gets interpolated and the resulting string is missing this required portion. I've tried various escapes all without success.

I'm out of ideas at this point. Hopefully the community here can provide an answer.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-10 18:20:48 -0500

lupin gravatar image

Try the answer on this 20375

edit flag offensive delete link more

Comments

Using '%%" only resulted in getting a '%" in the file. The rest of the line %{user} is still missing.

lclegg gravatar imagelclegg ( 2015-12-11 11:29:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-12-10 18:07:28 -0500

Seen: 136 times

Last updated: Dec 10 '15