Re: [Puppet Users] Error 400 on SERVER: Could not parse for environment production: Syntax error at '{'; expected '}'

898 views
Skip to first unread message

Justin Stoller

unread,
Aug 14, 2012, 1:04:06 PM8/14/12
to puppet...@googlegroups.com
On Tue, Aug 14, 2012 at 7:49 AM, Jen Patrick <jena...@gmail.com> wrote:
> It's barfing on this:

Is this in relation to a previous thread?

> Error 400 on SERVER: Could not parse for environment production: Syntax
> error at '{'; expected '}'

is there a line number?

>
> Here's the node.pp

Does this work?

>
> node "ccc.unix.ccc.ccc.edu" {
> class {
$static = {
"eth0" => {
"macaddress" => $macaddress_eth0,
"ipaddress" => "192.168.185.228",
"netmask" => "2255.255.255.128",
"gateway" => "192.168.185.129",
}
}

> "web_server":
net_static => $static,
># net_static => {
># "eth0" => {
># "macaddress" => $macaddress_eth0,
># "ipaddress" => "192.168.185.228",
># "netmask" => "2255.255.255.128",
># "gateway" => "192.168.185.129",
># }
># },
>
> environment => "production",
> unattended_update => true,
> nfs => false,
> proxy => false,
> apachessl => false,
> admins => ["void", "Null"];
> }
>
> apache::vhost {
> $fqdn:
> priority => '20',
> port => '80',
> docroot => '/var/www',
> }
>
>
>
> # open firewall from vpn
> firewall {
> "044 allow SSH from 192.168.10.0/23":
> action => "accept",
> proto => "tcp",
> dport => "22",
> source => '192.168.10.0/23';
> }
> }
>
> --
> 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/-/4wBjWB34Di8J.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

jcbollinger

unread,
Aug 15, 2012, 10:02:48 AM8/15/12
to puppet...@googlegroups.com


On Tuesday, August 14, 2012 9:49:53 AM UTC-5, Jen Patrick wrote:
It's barfing on this:
 Error 400 on SERVER: Could not parse for environment production: Syntax error at '{'; expected '}'

Here's the node.pp

  class {
     "web_server":
      net_static       => {
        "eth0"         => {
          "macaddress" => $macaddress_eth0,
          "ipaddress"  => "192.168.185.228",
          "netmask"    => "2255.255.255.128",
          "gateway"    => "192.168.185.129",
        }
      },


As a different thread recently discussed, although once Puppet accepted hash literals as parameter values, the most recent version does not.   I'm guessing the change was inadvertent, and there is already a ticket filed on it.  At this point, your options are
  • downgrade your master to a version that works (I'm not sure exactly which release broke, but I understand that 2.7.1 works), or
  • assign your hash to a variable, and assign the variable as the parameter value
  • dump class parametrization in favor of something better (i.e. almost anything else), such as hiera or global variables +/- ENC

John

Jeff McCune

unread,
Aug 15, 2012, 10:42:56 AM8/15/12
to puppet...@googlegroups.com
On Wed, Aug 15, 2012 at 7:02 AM, jcbollinger <John.Bo...@stjude.org> wrote:


On Tuesday, August 14, 2012 9:49:53 AM UTC-5, Jen Patrick wrote:
It's barfing on this:
 Error 400 on SERVER: Could not parse for environment production: Syntax error at '{'; expected '}'

Here's the node.pp

  class {
     "web_server":
      net_static       => {
        "eth0"         => {
          "macaddress" => $macaddress_eth0,
          "ipaddress"  => "192.168.185.228",
          "netmask"    => "2255.255.255.128",
          "gateway"    => "192.168.185.129",
        }
      },


As a different thread recently discussed, although once Puppet accepted hash literals as parameter values, the most recent version does not.

This is definitely a bug.  =(  John, do you know if it got filed as a ticket?

-Jeff

jcbollinger

unread,
Aug 15, 2012, 11:19:31 AM8/15/12
to puppet...@googlegroups.com


On Wednesday, August 15, 2012 9:42:56 AM UTC-5, Jeff McCune wrote:

This is definitely a bug.  =(  John, do you know if it got filed as a ticket?


I was thinking of this ticket: http://projects.puppetlabs.com/issues/14301.  On it's face, it's not exactly the same thing, but it's definitely related.  I would bet that the same change to the DSL grammar caused both issues, and that one fix can take care of both.


John

Reply all
Reply to author
Forward
0 new messages