I'm in the process of learning puppet and I'm running into what I assume is a pretty basic issue. For the purposes of keeping things simple, I'm using a puppet forge module rather than anything custom written. Here's what I'm using version wise:
puppet server: 5.1.3
puppet agent: 5.3.2
puppetlabs-java: 2.1.0
When I install the puppetlabs-java module, I am using --modulepath /etc/puppetlabs/code/modules/.
I currently have my agent configured to point at my puppet server and an environment I have named example.
The environment currently looks like this:
├── environment.conf
├── hiera.yaml
├── manifests
│ └── init.pp
└── modules
└── java.pp
I have done nothing to environment.conf and hiera.yaml, they are currently defaults. My init.pp contains:
node 'node1' {
}
node 'node2' {
}
and my java.pp contains:
class { 'java':
distribution => 'jre',
}
My issue is two fold. One if I place the java.pp in the manifest folder it applies java to both nodes, regardless of if I have called out an include java in either node. If I put the include java on either node, that works correctly and one node will get java and the other will not, but it does not appear to be respecting any of the settings I have in the java.pp. How can I accomplish only installing java to node1 with my custom settings in the java.pp file?
init.pptosite.ppand do not place any other manifests in that directory. Next read about dir envs: puppet.com/docs/puppet/5.3/environments_about.html. Then read about modules/classes: puppet.com/docs/puppet/5.3/modules_fundamentals.html. That will help you fix your organization and code problems and get moving forward. - Matt Schuchard