Once I've installed Puppet, Foreman, Hiera and Facter, how do I get them all to work with one another?
The Foreman GUI is operating properly and can be viewed using a browser. Hiera is installed, and by guides I read on the internet it seems like it's configured correctly and Facter also works properly, but agents are not getting modules from the Puppet server.
I've added a very simple MOTD module and configured it to run in common.yaml
.
But the module is not installed on agent machines and no error is displayed.
Running puppet agent -t
on the server and on clients works:
[root@puppet production]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppet.nj.peer39.com
Info: Applying configuration version '1425802774'
Notice: Finished catalog run in 0.05 seconds
[root@puppet production]#
hiera.yaml
looks like that:
[root@puppet production]# cat /etc/puppet/hiera.yaml
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata/%{::environment}'
:hierarchy:
- fqdns/%{::fqdn}
- roles/%{::role}
- domains/%{::domain}
- common
environment.conf
looks like that:
[root@puppet production]# pwd
/etc/puppet/environments/production
[root@puppet production]# cat environment.conf
modulepath = modules
manifest = /etc/puppet/environments/production/manifests/
[root@puppet production]#
I also tried loading the module through a fqdn.yaml
file but to no avail and no error is displayed.
/etc/puppet/puppet.conf
looks like that:
[master]
autosign = $confdir/autosign.conf { mode = 664 }
reports = foreman
external_nodes = /etc/puppet/node.rb
node_terminus = exec
ca = true
ssldir = /var/lib/puppet/ssl
certname = puppet.company.com
strict_variables = false
environmentpath = $confdir/environments
Edit #1:
My common.yaml
looks like that:
classes:
- motd
When I said fqdn.yaml
I meant:
[root@puppet fqdns]# pwd
/etc/puppet/hieradata/production/fqdns
[root@puppet fqdns]# ll
total 8
-rw-r--r-- 1 root root 23 Mar 11 09:26 pnd01.company.yaml
-rw-r--r-- 1 root root 17 Mar 12 08:24 puppet.company.com.yaml
[root@puppet fqdns]#
That's my site.pp
, which is located at /etc/puppet/environments/production/manifests
:
[root@puppet manifests]# cat site.pp
hiera_include("classes", [])
Package { allow_virtual => false, }
node default {
}