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" }
}


Side note, when there is only one parameter, the best practice is to put it 
all on one line.  

On Friday, December 7, 2012 8:49:19 AM UTC-8, Ugo Bellavance wrote:
>
> Hi,
>
> I am experimenting with foreman's apache module and there is this class 
> here:
>
> class apache::service {
>   $http_service = $::operatingsystem ? {
>     /(Debian|Ubuntu)/ => 'apache2',
>     default           => 'httpd',
>   }
>
>   service { $http_service:
>     ensure     => running,
>     enable     => true,
>     hasstatus  => true,
>     hasrestart => true,
>     alias      => 'httpd',
>     subscribe  => Package['httpd']
>   }
>
>   exec { 'reload-apache':
>     command     => "/etc/init.d/${http_service} reload",
>     onlyif      => '/usr/sbin/apachectl -t',
>     require     => Service['httpd'],
>     refreshonly => true,
>   }
>
> }
>
> I want to apply this class to a specific host, but I want to override the 
> enable parameter so that it is false.
>
> I tried this:
>
> node 'server1' {
>   class { 'apache::service':
>       enable  => false,}
> }
>
> But I always get this error:
>
> Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Invalid parameter enable at /etc/puppet/manifests/nodes/nodes.pp:40
>
> Any help would be appreciated.
>
> Thanks,
>
> Ugo
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/2k_xWFaMUAoJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to