I've been working through our local manifests with puppet-lint, trying
to make certain we're as prepared as possible for puppet 3.x. I would
like for our manifests to be warning-free. The class of warnings
related to long lines has me questioning what the best practice is to
avoid lines longer than 80 characters.
The two big offenders are URLs:
class foo {
yumrepo { 'some-repo':
baseurl => 'http://some-relatively-long-domain.com/some-path/centos$releasever/$basearch',
gpgcheck => '1',
descr => 'Some Yum Repository',
}
}
and obviously file resources:
class bar {
file {'/path/to/some/convenience/symlink':
ensure => file,
target => '/path/to/some/unfortunately/extremely/deep/file/that/we/want/to/manage/with/puppet',
}
}
but even "content" can at times exceed 80 columns.
I know I could be creating variables to help with line length, a la:
class foo {
$url_base = 'http://some-relatively-long-domain.com'
$url_path = '/some/url/path'
yumrepo { 'some-repo':
baseurl => "${base_url}${url_path}",
gpgcheck => '1',
descr => 'Some Yum Repository',
}
}
But that seems suboptimal, especially if there are things in the URL
(like $releasever/$basearch) that need to be preserved verbatim (they're
not puppet variables, they're for yum).
Is there a better way to break up long lines, perhaps a "join" function
I've missed that would allow me to do something like
class foo {
yumrepo { 'some-repo':
baseurl => join(
'',
'http://some-relatively-long-url.com',
'/some-path/centos$releasever/$basearch'
),
gpgcheck => '1',
descr => 'Some Yum Repository',
}
}
Thanks,
Tim
--
Tim Mooney Tim.Mooney@ndsu.edu
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Tim Mooney Tim.Mooney@ndsu.edu
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.