On 11/17/15 2:51 PM, [email protected] wrote:
> Hi G,
> 
> sounds great.
> 
> How would you use the indentation in
> 
> Somesoftware::Mariadb:: ...
> 
> The same position as the require? Or two characters on the right? I'm
> asking because resources can be already indented (e.g. two chars) and
> the second line then starts at position 1 on the new line.
> 
> I'm still wondering when to use the Backslash. On some sources (e.g.
> http://stackoverflow.com/questions/11406234/puppet-how-can-i-wrap-a-command-into-two-line-if-80-characters
> ) it's recommended but it didn't work on my machine.
> 
> 
> Am Dienstag, 17. November 2015 20:35:49 UTC+1 schrieb Garrett Honeycutt:
> 
>     On 11/17/15 11:08 AM, [email protected] <javascript:> - tracked
>     <javascript:> wrote:
>     > Hi,
>     >
>     > I got a file resource
>     >
>     >   file
>     {'/usr/java/jboss-as/server/somesoftware/deploy/jontram-ds.xml':
>     >     ensure  => file,
>     >     owner   => 'root',
>     >     group   => 'root',
>     >     mode    => '0655',
>     >     content => template('somesoftware/jboss/jontram-ds.xml.erb'),
>     >     require => [ Class['somesoftware::cpfiles'],
>     > somesoftware::mariadb::createdb [ $db_name ] ],
>     >   }
>     >
>     > The second last line is obviously to long (over 80 lines). It
>     works in
>     > one line but I get a puppet-lint error. I would like to cut it it
>     two.
>     > My first thought was to use the '\'
>     >
>     > like
>     >     require => [ Class['somesoftware::cpfiles'],\
>     > somesoftware::mariadb::createdb [ $db_name ]
>     >   }
>     >
>     > but then I get an error
>     >
>     > Error: Could not retrieve catalog from remote server: Error 400 on
>     > SERVER: Syntax error at '\'; expected ']' at  ...
>     >
>     > It works if I just press enter at the end of the line and write
>     the rest
>     > on the next line (without the \).
>     >
>     > So I wonder is it right to not use \ for line wrapping? If yes
>     where can
>     > I find documentation about that behavior?
>     >
> 
>     Hi Tobias,
> 
>     Somehow line length was added to the style guide, though Puppet does
>     not
>     provide a mechanism, such as `\` to denote line wrapping. While not
>     having huge lines is a good idea, adhering to an arbitrary limit
>     without
>     the ability to wrap to the next line is not. Suggest turning it off. In
>     fact, we disable it by default[1] when creating new modules.
> 
>     You can limit the length of your require like this
> 
>     file { '/usr/java/jboss-as/server/somesoftware/deploy/jontram-ds.xml':
>     ensure => file,
>     owner => 'root',
>     group => 'root',
>     mode => '0655',
>     content => template('somesoftware/jboss/jontram-ds.xml.erb'),
>     require => [Class['somesoftware::cpfiles'],
>     Somesoftware::Mariadb::Createdb[$db_name],
>     ],
>     }
> 
>     In general, putting elements of an array on multiple lines helps
>     readability, especially when reviewing diffs.
> 
>     [1] -
>     
> https://github.com/puppetlabs/puppet/blob/1a557254012447a4f0a2e01eeebaf52c75ab6f80/lib/puppet/module_tool/skeleton/templates/generator/Rakefile#L3
>     
> <https://github.com/puppetlabs/puppet/blob/1a557254012447a4f0a2e01eeebaf52c75ab6f80/lib/puppet/module_tool/skeleton/templates/generator/Rakefile#L3>
>  - tracked
>     
> <https://github.com/puppetlabs/puppet/blob/1a557254012447a4f0a2e01eeebaf52c75ab6f80/lib/puppet/module_tool/skeleton/templates/generator/Rakefile#L3>
> 
> 
>     Best regards,
>     -g
> 
>     -- 
>     Garrett Honeycutt
>     @learnpuppet
>     Puppet Training with LearnPuppet.com
>     Mobile: +1.206.414.8658
> 

Hi Tobias,

Backslash does not work with puppet manifests. There is not a way to
wrap to the next line.

Seems my example got lost in formatting. Here's a link.

http://pastebin.com/26eSAJBu

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/564B89EA.2080600%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to