Tim Dunphy
2011-Feb-09 20:28 UTC
[Puppet Users] Syntax error at ''enable''; expected ''}''
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Sergey Zhuga
2011-Feb-09 20:34 UTC
[Puppet Users] Re: Syntax error at ''enable''; expected ''}''
Hi,> service { sshd: > name => $operatingsystem ? { > centos => "sshd", > default => "sshd", > }comma> enable => true, > ensure => running > > }-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Tim Dunphy
2011-Feb-09 21:38 UTC
Re: [Puppet Users] Re: Syntax error at ''enable''; expected ''}''
Hello,
I tried placing a comma where you suggested. However that did not
appear to make any difference. Do you have any other thoughts?
[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
end of file; expected ''}'' at
/etc/puppet/manifests/classes/baseapps.pp:31
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
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
}
}
thanks!!
On Wed, Feb 9, 2011 at 3:34 PM, Sergey Zhuga <sergey.zhuga@gmail.com>
wrote:> Hi,
>
>> service { sshd:
>> name => $operatingsystem ? {
>> centos => "sshd",
>> default => "sshd",
>> }
>
> comma
>
>> enable => true,
>> ensure => running
>>
>> }
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
>
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Atha Kouroussis
2011-Feb-09 21:43 UTC
[Puppet Users] Re: Syntax error at ''enable''; expected ''}''
Hi Tim,
you are missing a closing }
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
}
} <- missing
}
Cheers,
Atha
On Wednesday, February 9, 2011 at 6:38 PM, Tim Dunphy wrote:
Hello,>
> I tried placing a comma where you suggested. However that did not
> appear to make any difference. Do you have any other thoughts?
>
> [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
> end of file; expected ''}'' at
> /etc/puppet/manifests/classes/baseapps.pp:31
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
>
>
>
> 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
>
> }
>
>
> }
>
> thanks!!
>
>
> On Wed, Feb 9, 2011 at 3:34 PM, Sergey Zhuga <sergey.zhuga@gmail.com>
wrote:
> > Hi,
> >
> > > service { sshd:
> > > name => $operatingsystem ? {
> > > centos => "sshd",
> > > default => "sshd",
> > > }
> >
> > comma
> >
> > > enable => true,
> > > ensure => running
> > >
> > > }
> >
> > --
> > 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+unsubscribe@googlegroups.com.
> > For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
>
>
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Tim Dunphy
2011-Feb-09 21:48 UTC
Re: [Puppet Users] Re: Syntax error at ''enable''; expected ''}''
Hi guys,
got it worked out!!!
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 => $operatingsytem ? {
centos => "sshd",
default => "sshd",
},
enable => true,
ensure => running
}
}
}
Thanks so much for your help!!
:-)
On Wed, Feb 9, 2011 at 4:43 PM, Atha Kouroussis <akouroussis@gmail.com>
wrote:> Hi Tim,
> you are missing a closing }
> 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
> }
> } <- missing
> }
> Cheers,
> Atha
>
> On Wednesday, February 9, 2011 at 6:38 PM, Tim Dunphy wrote:
>
> Hello,
>
> I tried placing a comma where you suggested. However that did not
> appear to make any difference. Do you have any other thoughts?
>
> [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
> end of file; expected ''}'' at
> /etc/puppet/manifests/classes/baseapps.pp:31
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
>
>
>
> 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
>
> }
>
>
> }
>
> thanks!!
>
>
> On Wed, Feb 9, 2011 at 3:34 PM, Sergey Zhuga <sergey.zhuga@gmail.com>
wrote:
>
> Hi,
>
> service { sshd:
> name => $operatingsystem ? {
> centos => "sshd",
> default => "sshd",
> }
>
> comma
>
> enable => true,
> ensure => running
>
> }
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Patrick
2011-Feb-09 21:51 UTC
Re: [Puppet Users] Syntax error at ''enable''; expected ''}''
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 localhostYep. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.