Re: [Puppet Users] Syntax error at 'enable'; expected '}'

2011-02-09 Thread Patrick

On Feb 9, 2011, at 12:28 PM, Tim Dunphy wrote:

> Hello puppet list!!
> 
> 
> 
> I keep getting the same error and I can't for the life of me see
> where this problem is...
> 
> 
> [root@VIRTCENT03:~] #puppetd --test
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not parse for environment production: Syntax error at
> 'enable'; expected '}' at /etc/puppet/manifests/classes/baseapps.pp:23
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
> 

Well, the problem seems to be in the service line so you can cut your manifest 
down to this and try it without the master after replacing the variable:

test.pp:
include testClass
class testClass
{
#Pretends we have factor
$operatingsystem = "centos"
service { sshd:
name => $operatingsystem ? {
centos => "sshd",
default => "sshd",
}
enable => true,
ensure => running
}
}


Then run it again and see if you get the same error without the master.

puppet --verbose test.pp

> Could not parse for environment production: Syntax error at 'enable'; 
> expected '}' at /removed_path/test2.pp:10 on node localhost

Yep.  Still have the error.  Now you can test it much easier.

Now, in this case, your problem is because you missed a comma after closing the 
operating system selector.  Still, if you can shrink your manifest and remove 
the puppetmaster, it will help us in the future.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
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.



[Puppet Users] Syntax error at 'enable'; expected '}'

2011-02-09 Thread Tim Dunphy
Hello puppet list!!



 I keep getting the same error and I can't for the life of me see
where this problem is...


[root@VIRTCENT03:~] #puppetd --test
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not parse for environment production: Syntax error at
'enable'; expected '}' at /etc/puppet/manifests/classes/baseapps.pp:23
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run



Here is the manifest it is erroring out on:


class baseapps {

 $packagelist = [ "nmap","php-common","php-cli","perl","keychain","screen" ]

 package { $packagelist:
   ensure => installed }


class sshd {
  case $operatingsystem {
   centos: { $ssh_packages = [
"openssh","openssh-server","openssh-clients"] }
   default: { $ssh_packages = [ "openssh", "openssh-server" ] }
  }

  package { $ssh_packages: ensure => installed }

  service { sshd:
   name => $operatingsystem ? {
centos => "sshd",
default => "sshd",
   }

  enable => true,
  ensure => running

 }


}


Could someone please lend an eye?

Thanks!!

-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
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.