Perhaps try removing the final trailing comma after enable => "false". Some
Puppet versions have a problem with this.

  - Keith
On 24 Jun 2013 01:11, "Manoj Bhola" <mbhol...@gmail.com> wrote:

> Hi,
>
> I hope someone can help.
>
> I have created a custom class module which updates a configuration file.
>
> When I use the puppet command: puppet -e "include custom", the file is
> replaced using the template file included in the module correctly.
>
> When I try to update settings in the configuration file using a manifest
> which uses my custom module, I get the following error from puppet: syntax
> error at '{'; expected '}' at /root/httpstk1.pp:1
>
> Class Module
> -------------------
>
> class novell-httpstkd {
>
> # Check OES Version. Requires the oes facter additions
> #
> case $oes {
>   OES11: {
>     $conf_template = 'httpstkd.conf.oes11.erb'
>   }
>   OES2: {
>     $conf_template = 'httpstkd.conf.oes2.erb'
>   }
>   default: { fail("Sorry your OES Version is not recognized") }
> }
>
> notify {addr-setting:
>   message => "Following variables will be used:\naddr  = $addr | saddr =
> $saddr | filteraddr = $filteraddr | filtersubnet = $filtersubnet | cipher =
> $cipher | mailserver = $mailserver | mailfrom = $mailfrom | mailto =
> $mailto | nolum = $nolum | supervisoronly = $supervisoronly | httponly =
> $httponly | inventoryresolvelumownername = $inventoryresolvelumownername",
> }
>
> if $addr == "" {
>   $_addr = "0.0.0.0:8008"
> }
> else {
>   $_addr = $addr
> }
>
> if $saddr == "" {
>   $_saddr = "0.0.0.0:8009"
> }
> else {
>   $_saddr = $saddr
> }
>
> if $filteraddr == "" {
>   $_filteraddr = ""
> }
> else {
>   $_filteraddr = $filteraddr
> }
>
> if $filtersubnet == "" {
>   $_filtersubnet = ""
> }
> else {
>   $_filtersubnet = $filtersubnet
> }
>
> if $cipher == 'all' or $cipher == 'low' or $cipher == 'medium' or $cipher
> == 'high' {
>   $_cipher = $cipher
> }
> else {
>   $_cipher = 'all'
> }
>
> if $mailserver == "" {
>   $_mailserver = ""
> }
> else {
>   $_mailserver = $mailserver
> }
>
> if $mailto == "" {
>   $_mailto = ""
> }
> else {
>   $_mailto = $mailto
> }
>
> if $mailfrom == "" {
>   $_mailfrom = ""
> }
> else {
>   $_mailfrom = $mailfrom
> }
>
> if $nolum == 'true' or $nolum == 'false' {
>   $_nolum = $nolum
> }
> else {
>   $_nolum = 'false'
> }
>
> if $supervisoronly == 'true' or $supervisoronly == 'false' {
>   $_supervisoronly = $supervisoronly
> }
> else {
>   $_supervisoronly = 'false'
> }
>
> if $httponly == 'true' or $httponly == 'false' {
>   $_httponly = $httponly
> }
> else {
>   $_httponly = 'true'
> }
>
> if $inventoryresolvenonlumownername == 'true' or
> $inventoryresolvenonlumownername == 'false' {
>   $_inventoryresolvenonlumownername = $inventoryresolvenonlumownername
> }
> else {
>   $_inventoryresolvenonlumownername = 'false'
> }
>
> if $ensure != "running" or $ensure != "stopped" {
>   $ensure = "running"
> }
>
> if $enable != "true" or $enable != "false" {
>   $enable = "true"
> }
>
> file {'httpstkd_conf':
>   path => '/etc/opt/novell/httpstkd.conf',
>   ensure => file,
>   content => template("novell-httpstkd/${conf_template}"),
>   owner => 'root',
>   group => 'root',
>   mode => '755',
> }
>
> service {'novell-httpstkd':
>   name => 'novell-httpstkd',
>   ensure => $ensure,
>   enable => $enable,
>   subscribe => File['httpstkd_conf'],
> }
>
> }
>
> Manifest (This errors calling the above module)
>
> class {novell-httpstkd:
>
>   addr => "$ipaddress",
>   saddr => "$ipaddress",
>   filteraddr => "192.168.69.20",
>   filtersubnet => "192.168.1.0 255.255.255.0",
>   cipher => "low",
>   mailserver => "mail.localdomain",
>   mailfrom => "nrm@$fqdn",
>   mailto => "supportadmin@localdomain",
>   enable => "false",
> }
>
>
> Manoj
>
>  --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to