-1

Iv recently installed a puppetmaster and im trying to configure a puppet class with a nested resource. eg.

class base {
     user { 'testuser':
            name => 'test',
            ensure => present,
            comment => 'Test User',
            expiry => '2014-06-30',
            gid => '100',
            groups => 'wheel',
            password_max_age => "60",
            managehome => true,
            shell => "/bin/bash",
            password => '*password*',
            exec {
              "usermod -p '${password}' ${user}":
                    onlyif => "egrep -q '^${user}:[*!]' /etc/shadow",
                    require => User[$user],
                 },
           }
}

Problem is i keep getting a syntax error:

 [root@puppetclient ~]# puppet agent -t \\
 Info: Retrieving plugin
 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '{'; expected '}' at /etc/puppet/environments/dev/modules/base/manifests/init.pp:13 on node puppetclient
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run

What am i missing?

1 Answer 1

5

Ressources cannot be nested. They can only have dependencies on each other.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .