Reputation: 191
I'm just trying to get my head around puppet, and decided to get stuck in using a really simple module.
I'm using puppet version 3.6.2
I've used the command
puppet module generate tsv-tsvversion
It created the following module stub
/etc/puppet/modules/
└── tsv-tsvversion
├── manifests
│ └── init.pp
├── metadata.json
├── Rakefile
├── README.md
├── spec
│ ├── classes
│ │ └── init_spec.rb
│ └── spec_helper.rb
└── tests
└── init.pp
The init.pp in manifests looks like
class tsvversion {
group {'test':
ensure => present,
}
user { 'matt':
ensure => 'present',
comment => 'Matt',
gid => 'test',
home => '/home/matt',
password => '',
password_max_age => '-1',
password_min_age => '-1',
shell => '/bin/bash',
uid => '2002',
managehome => 'true',
}
}
My modules seem to be on the modulepath
/etc/puppet/modules:/usr/share/puppet/modules
The manifests/site.pp looks like
node default {
Package { allow_virtual => false, }
include 'tsvversion'
}
When I run this on the puppet master
puppet agent --test --verbose
it fails with
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class tsvversion for puppet.tsvtest on node puppet.tsvtest
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Before posting, i've checked to make sure i'm using lowercase, and no silly characters.
I'm struggling to understand why it fails.
Can anyone help ?
Thanks
Matt
Upvotes: 2
Views: 1068
Reputation: 8223
The root directory of your module must not be named tsv-tsvversion
. The author prefix is only intended for metadata that controls behavior on the Forge, and for downloading using puppet module install
.
This may not be through any fault of your's, but rather a shortcoming of the puppet module generate
subcommand. (This might even be a bug.)
Try and rename or link your module to /etc/puppet/modules/tsvversion
. Your practices look sound otherwise.
Upvotes: 3