willdurand/puppet-nodejs — pull request #79 by grafjo (2014-12-01 12:04:22+00:00)
Title: Fix for issue `Duplicate declaration: File[nodejs-default-symlink]`

Installing a few versions of node like attached example triggers puppet
run to fail with `Duplicate declaration: File[nodejs-default-symlink]`

The cause of this problem is a `define` vs `class` issue. When a symlink
like `/usr/local/bin/node` is desirable, the `class {'nodejs':} has to
handle this symlink.

Manifest:

```puppet
nodejs::install { 'v0.10.17':
version => 'v0.10.17',
}
nodejs::install { 'v0.10.25':
version => 'v0.10.25',
}
```

Error:

```bash
...
==> precise64: Running provisioner: puppet...
==> precise64: Running Puppet with site.pp...
==> precise64: stdin: is not a tty
==> precise64: Duplicate declaration: File[nodejs-default-symlink] is
already declared in file /tmp/vagrant-
puppet-3/modules-0/nodejs/manifests/install.pp at line 188; cannot
redeclare at /tmp/vagrant-
puppet-3/modules-0/nodejs/manifests/install.pp:188 on node
precise64.example.com
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

puppet apply --modulepath '/tmp/vagrant-
puppet-3/modules-0:/etc/puppet/modules' --manifestdir /tmp/vagrant-
puppet-3/manifests --detailed-exitcodes /tmp/vagrant-
puppet-3/manifests/site.pp

Stdout from the command:

Stderr from the command:

stdin: is not a tty
Duplicate declaration: File[nodejs-default-symlink] is already declared
in file /tmp/vagrant-puppet-3/modules-0/nodejs/manifests/install.pp at
line 188; cannot redeclare at /tmp/vagrant-
puppet-3/modules-0/nodejs/manifests/install.pp:188 on node
precise64.example.com
```