I installed Puppet 3.1.1 on an Ubuntu Server.
My manifests folder looked like this:
├── nodes
│ └── test1.pp
└── site.pp
The content of site.pp was:
# site.pp
import "nodes/*.pp"
Node test1 worked OK.
Then I created a new file named test2.pp
. The content was the same as test1.pp except for the node name, and I added it into the nodes folder.
So the manifests folder became this:
├── nodes
│ ├── test1.pp
│ └── test2.pp
└── site.pp
I then ran puppet agent --test
on node test2.
The agent could exchange SSL keys with the puppet master, but I got an error message:
Could not find default node or by name with test2
If I don't create a new test2.pp
file, and just add the content into the test1.pp
file, no error appears.
So I am thinking Puppet will not dynamically import a new pp file after the puppet master has been started.
Is is possible to define nodes in individual pp files and dynamically import them?
Glad for any suggestions.
The content of the two pp files:
node 'test1' {
include tmp::params
tmp::gtp { 'node1':
name => 'node1',
version => '6.0.0.0',
ip => '168.1.193.97',
port => '1255',
}
}
node 'test2' {
include tmp::params
tmp::gtp { 'node2':
name => 'node2',
version => '6.0.0.0',
ip => '168.1.193.98',
port => '1255',
}
}