Syntax error

26 views
Skip to first unread message

David Logan

unread,
Sep 21, 2014, 9:53:49 PM9/21/14
to puppet...@googlegroups.com
Hi Folks,

I've tried this snippet several ways, both using case and selector statements. I keep getting an error

root@ubuntu64:/etc/puppet/manifests# puppet parser validate /etc/puppet/modules/timezone/manifests/params.pp
Error: Could not parse for environment production: Syntax error at '=>'; expected '}' at /etc/puppet/modules/timezone/manifests/params.pp:25
root@ubuntu64:/etc/puppet/manifests#



<comments above have been taken out>

 15 class timezone::params {
 16
 17   $timezone = 'Australia/Darwin'
 18   $hw_utc = true
 19
 20 # This is calculated in timezone class
 21   $set_timezone_command = ''
 22
 23   case $::operatingsystem {
 24     /^(?i:Debian|Ubuntu)$/: {
 25       $config_file => '/etc/timezone'
 26     }
 27     /^(?i:RedHat|CentOS)$/: {
 28       case $::operatingsystemmajrelease {
 29         '7':     $config_file => '/etc/localtime'
 30         default: $config_file => '/etc/sysconfig/clock'
 31       }
 32     }
 33     default: { $config_file => '/etc/sysconfig/clock' }
 34   }
 35
 36   $config_file_mode = $::operatingsystem ? {
 37     default => '0644',
 38   }
 39
 40   $config_file_owner = $::operatingsystem ? {
 41     default => 'root',
 42   }
 43
 44   $config_file_group = $::operatingsystem ? {
 45     'FreeBSD' => 'wheel',
 46     default   => 'root',
 47   }
 48
 49   $source = ''
 50   $template = "timezone/timezone-${::operatingsystem}"
 51   $options = ''
 52   $audit_only = false
 53   $noops = false
 54
 55 }

If somebody wouldn't mind pointing out the error my ways, that would be most appreciated.

Thanks
David

Denmat

unread,
Sep 22, 2014, 5:14:23 PM9/22/14
to puppet...@googlegroups.com
Hi,

Try $config_file = 'value'.

You need to assign the value. 


Cheers
Den

On 22 Sep 2014, at 11:53, David Logan <skra...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages