Duplicate class error on Puppet Enterprise Hiera config

70 views Asked by At

I'm getting the following error while running puppet agent -t

Duplicate declaration: Class[MyModule] is already declared; cannot redeclare on node mynode.mydomain.com

I'm using heira as my approach. In mynode.mydomain.com.yaml I have the following

classes:
  - MyModule:elasticsearch

mtd::elasticsearch::install_dir: /opt/es
mtd::elasticsearch::version: 1.5.1
mtd::elasticsearch::master_node: true
mtd::elasticsearch::data_node: true
mtd::elasticsearch::cluster: elasticsearch
1

There are 1 answers

0
Sam Hammamy On

The problem was quite simple. The node was registered on the Web UI with the MyModule as a class already. So deleting the node from the Web UI and then re-running puppet agent -t solved the problem.