How to comment multiple lines on configurations file

3,004 views
Skip to first unread message

Amber Mehra

unread,
Nov 21, 2016, 5:35:55 AM11/21/16
to Puppet Users
Hey Guys,

I need to comment multiple lines on some configuration files, Please let me know how to accomplish this task using puppet manifest?

Best 

Henrik Lindberg

unread,
Nov 23, 2016, 6:31:49 PM11/23/16
to puppet...@googlegroups.com
Comments in puppet are either

# This is a line comment

or

/* this is a
multiline
comment
*/

The later is normally not used and the style guide prescribes that only
# comments should be used. There is however nothing stopping you from
commenting out larger sequences of code with /* */. Note that you cannot
comment out other /* */ comments, but commenting out # comments works
fine. (This is one reason for never using /* */ for normal comments, so
when in a pinch you can comment out a larger block of code).

If you find that you need to do that and keep the commented out block
for a longer period of time, then that is a sign of "not doing it
right", and you should probably be using branches in Git and simply
remove the code and keep the alternative version in a branch.

Hope that helps.
- henrik

> --
> 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
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/2f97d3f3-d094-479f-bee6-1a67c3d0b8e9%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/2f97d3f3-d094-479f-bee6-1a67c3d0b8e9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Amber Mehra

unread,
Nov 24, 2016, 12:33:47 AM11/24/16
to Puppet Users
Hey Henrik,

I want to comment out using puppet manifest, I found resource type which i can use "file_line", it manage file stuff pretty nicely 
Reply all
Reply to author
Forward
0 new messages