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
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 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
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
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.