On Tue, Dec 11, 2012 at 3:47 PM, Jason Cochard <[email protected]>wrote:
> This class does not accept any parameters, thus why it is failing. You
> could easily modify it though to do so:
>
> class apache::service ( $enable = "true",)
> {
>
> ...snip...
>
> service { $http_service:
> ensure => running,
> enable => *$enable*,
> hasstatus => true,
> hasrestart => true,
> alias => 'httpd',
> subscribe => Package['httpd']
> }
> ...snip...
>
> Then call it like this on the node:
> node 'server1' {
> class { "apache::service": enable => "false" }
> }
>
>
Wow, with just that, I'll be able to do that with all my modules that need
to accept parameters.
>
> Side note, when there is only one parameter, the best practice is to put
> it all on one line.
>
Ok, I wonder if puppet-lint would have caught that.
Thanks a lot,
Ugo
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.