FAQ
Version: puppet-3.2.3-1.el6.noarch.rpm
--------------------------

I just try to create a class as parameters container like this:

cat > /etc/puppet/modules/ssh/manifests/params.pp << EOF
class ssh::params {
     $ssh_package_name = $::operatingsystem ? {
         'solaris' => 'openssh',
         'centos' => 'openssh-server',
     }
}
EOF

but there is an error in agent like this:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Syntax error at '='; expected '}' at
/etc/puppet/modules/ssh/manifests/params.pp:2 on node
basecentos.mhszdomain.com

I saw it in the manual like this:
---------------------------Error again...
$group = $operatingsystem ? {
     solaris => 'sysadmin',
     default => 'wheel',
}

then I try different type of it:

---------------------------Error again...
class ssh::params {
     $ssh_package_name = $::operatingsystem ? {
         'solaris' => 'openssh',
         'centos' => 'openssh-server'
     }
}
---------------------------Error again...
class ssh::params {
     $ssh_package_name = $::operatingsystem ? {
         solaris => 'openssh',
         centos => 'openssh-server',
     }
}
---------------------------Error again...
class ssh::params {
     $ssh_package_name = $::operatingsystem ? {
         solaris => 'openssh',
         'centos' => 'openssh-server',
     }
}
---------------------------Error again...
class ssh::params {
     $sshss = $operatingsystem ? { solaris => 'openssh' }
}
---------------------------Error again...
class ssh::params {
     $sshss = $operatingsystem ? { 'solaris' => 'openssh' }
}

so..what happens? does anyone could help me?

--
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+unsubscribe@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.

Search Discussions

  • Jcbollinger at Aug 5, 2013 at 1:11 pm

    On Friday, August 2, 2013 10:03:19 AM UTC-5, cvv...@gmail.com wrote:
    Version: puppet-3.2.3-1.el6.noarch.rpm
    --------------------------

    I just try to create a class as parameters container like this:

    cat > /etc/puppet/modules/ssh/manifests/params.pp << EOF
    class ssh::params {
    $ssh_package_name = $::operatingsystem ? {
    'solaris' => 'openssh',
    'centos' => 'openssh-server',
    }
    }
    EOF

    but there is an error in agent like this:

    Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Syntax error at '='; expected '}' at
    /etc/puppet/modules/ssh/manifests/params.pp:2 on node
    basecentos.mhszdomain.com

    I saw it in the manual like this:
    ---------------------------Error again...
    $group = $operatingsystem ? {
    solaris => 'sysadmin',
    default => 'wheel',
    }

    then I try different type of it:
    [...]

    so..what happens? does anyone could help me?
    >


    Something seems very broken here. Selectors (the feature you are trying to
    use) have been in the Puppet language for a long time, and they work fine
    all over the place. I doubt there are many Puppet sites that don't use
    them.

    What strikes me as odd is that the Puppet parser complains about the '='
    sign, which is not part of the selector expression. Do you still get the
    error with something like

    class ssh::params {
       $ssh_package_name = 'ssh'
    }

    ? Does it help (or change anything) if you put the whole selector
    expression in parentheses?

    Is there any chance that you are getting unexpected (by Puppet)
    non-printing characters in your manifest files when you create them via I/O
    redirection as you show? That wouldn't happen in the POSIX or C locale,
    but perhaps it could in some other locales, under some circumstances.


    John

    --
    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+unsubscribe@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.
  • Dan White at Aug 5, 2013 at 1:18 pm
    Could the problem be the variable name : "group" ?

    That is a Puppet Type

    Try changing it.

    Hope this helps. Just a wild guess.


    “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "jcbollinger" <john.bollinger@stjude.org>
    To: puppet-users@googlegroups.com
    Sent: Monday, August 5, 2013 9:11:29 AM
    Subject: [Puppet Users] Re: It's my mistake or a bug about define a variable in class?



    On Friday, August 2, 2013 10:03:19 AM UTC-5, cvv...@gmail.com wrote:


    Version: puppet-3.2.3-1.el6.noarch.rpm
    --------------------------

    I just try to create a class as parameters container like this:

    cat > /etc/puppet/modules/ssh/manifests/params.pp << EOF
    class ssh::params {
    $ssh_package_name = $::operatingsystem ? {
    'solaris' => 'openssh',
    'centos' => 'openssh-server',
    }
    }
    EOF

    but there is an error in agent like this:

    Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '='; expected '}' at /etc/puppet/modules/ssh/manifests/params.pp:2 on node basecentos.mhszdomain.com

    I saw it in the manual like this:
    ---------------------------Error again...
    $group = $operatingsystem ? {
    solaris => 'sysadmin',
    default => 'wheel',
    }

    then I try different type of it:




    [...]


    <blockquote>




    so..what happens? does anyone could help me?
    </blockquote>



    Something seems very broken here. Selectors (the feature you are trying to use) have been in the Puppet language for a long time, and they work fine all over the place. I doubt there are many Puppet sites that don't use them.

    What strikes me as odd is that the Puppet parser complains about the '=' sign, which is not part of the selector expression. Do you still get the error with something like

    class ssh::params {
    $ssh_package_name = 'ssh'
    }

    ? Does it help (or change anything) if you put the whole selector expression in parentheses?

    Is there any chance that you are getting unexpected (by Puppet) non-printing characters in your manifest files when you create them via I/O redirection as you show? That wouldn't happen in the POSIX or C locale, but perhaps it could in some other locales, under some circumstances.


    John



    --
    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+unsubscribe@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+unsubscribe@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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedAug 2, '13 at 8:06p
activeAug 5, '13 at 1:18p
posts3
users3
websitepuppetlabs.com

3 users in discussion

Dan White: 1 post Cvvnx1: 1 post Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase