I know how to declare foreman hostgroups using the online portal but how do you make it affect a host? Also where does all the manifests/module regarding the host group go? And is there a particular format to it?
Thanks for replying in advance!
I know how to declare foreman hostgroups using the online portal but how do you make it affect a host? Also where does all the manifests/module regarding the host group go? And is there a particular format to it?
Thanks for replying in advance!
You need to set the host group on the host, by going to the hosts list (Hosts > All hosts), click Edit next to the host and select the host group from the dropdown list, then Submit. Any Puppet classes you set on the host group will apply to that host.
You can also set the host group on multiple hosts from the host list by using the tickboxes on the left, then choosing Change Group from the Select Action dropdown menu in the drop right.
Your Puppet modules go into the regular Puppet modulepath for the environment that your host is in. If your host is in the "production" environment, then this would usually be
/etc/puppet/environments/production/modules/
. Paths such as/etc/puppet/modules/
are usually configured in Puppet'sbasemodulepath
and should apply to all environments.The layout of modules needs to meet Puppet's autoloader layout, which gives a predictable structure so Puppet can find them. If you were adding an
ntp
class, it'd probably be in/etc/puppet/environments/production/modules/ntp/manifests/init.pp
.Once you've put your module(s) on the filesystem then you can import them under Configure > Puppet classes > Import. If they don't show up, check the syntax with
puppet parser validate init.pp
etc.