I wanted to install splunkforwarder and none of the existing modules were working. So, I just decided to write it from scratch, except, fun story, I'm caught up at just installing the package.
So, I created a repository on my puppet master server. The repository works. If I do a yum install on my client, I'm able to install the splunkforwarder and it installed it properly under /opt. So, the repository to me is not the problem.
So, I just wanted the most basic of basic installs where there is no configuration.
class splunk2 {
package { "splunkforwarder": ensure => "installed" }
}
This didn't work. There are no logs and the client doesn't throw an error -- nor does it mention installing it.
There are only two files; init.pp and up.pp
init.pp only contains;
class splunk2 {
}
Still the same issue. I just can't think of what's going wrong because it seems like this should be incredibly basic if I just want it to install the package.
Any ideas :(?
Edit: I did put in lololdolaol into the up.pp and puppet didn't complain. It's almost like it's ignoring this module.
Yes, Puppet is ignoring the module because it is not structured in a way the Puppetmaster's class autoloader accepts.
Starting from the beginning, where do your modules live? Probably in
/etc/puppet/modules
. So in there you have the following directory and file structure:There are a few other directories in the module structure but these three are by far the most used and most important. The
files
andtemplates
directories are optional while themanifests
directory is mandatory if your module contains classes, or, more general, manifests. In there you put your classes. A fileinit.pp
is also, in most cases, mandatory.Your module directories and files now looks like this:
Your
init.pp
can contain all the magic:You have defined a class "splunkforwarder" which manages a single package of the same name. You can now do
in your node configuration and the splunkforwarder package should be installed on the next Puppet run.