0

I'm bit new to puppet, but I'm not sure how this would become a duplicate declaration, can someone please give me some direction whether this is a correct usage of class passing params or not?

Error: Duplicate declaration: Class[Jenkins_dotfiles] is already declared in file /tmp/puppet-manifests-test/manifests/site.pp:193; cannot redeclare at /tmp/puppet-manifests-test/manifests/site.pp:193

With this code:

$user = 'jenkins'
$group = 'staff'
$home = "/Users/${user}"
...
if ($is_jenkins) {
    class {
        'jenkins_dotfiles':
            home => '/var/root',
            user => 'root';
        'jenkins_dotfiles':
            home => $home,
            user => $user;

jenkins_dotfiles/manifests/init.pp

 class jenkins_dotfiles($home, $user) {
 ...
 }
samxiao
  • 101
  • 3

1 Answers1

3

You are declaring it twice. Once with the parameter values '/var/root', 'root', the other with the parameters $home and $user. You probably should be making jenkins_dotfiles a defined type, not a class.

Artefacto
  • 1,045
  • 1
  • 8
  • 11