P
P
Pasha2014-08-04 23:40:50
Puppet
Pasha, 2014-08-04 23:40:50

Puppet apply - how to make a simple module to raise a web server?

Hello
Help me understand how to configure Puppet (or how to style a module) to work well apart from its client-server orientation.
More precisely, I just sometimes need to raise servers with the same configuration (PHP, Nginx, MySQL, etc.) and in order not to do the mechanical work many times - I decided to write a manifest and apply it with "puppet apply" I
started to understand Puppet 2 * - everything seemed to work - I wrote in puppet.conf modulepath - the path to the folder in which I developed the module, created the folder structure of the module, several classes, I managed to make an include of another class from the init.pp file and it worked.
Then I noticed that the version is old, and there is 3.6 - I installed it and everything broke :)
- modulepath in puppet.conf became deprecated - had to remove it from there, it is suggested to use Directory Environments instead . How - I can not understand. All I need is for the module to work in a directory other than /etc/puppet/modules/
- Include classes stopped working - the same code that worked on version 2 now throws "Error: Could not find class kp::testfile for precise32.mynet .lan on node precise32.mynet.lan"
Example - A module with two manifests: init.pp and testfile.pp used in it (just creates a file with content from the template in the /tmp folder)
I call it from the manifests folder, where init.pp is located
puppet apply init.pp
In Puppet 3.6 it fails
"Error: Could not find class kp::testfile for precise32.mynet.lan on node precise32.mynet.lan"
How can I overcome this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
baskoy, 2014-08-15
@baskoy

Well, it's clear -Could not find class kp::testfile.
In theory, puppet apply testfile.pp --debug should run without problems. At least on a freshly installed pappet, I did not see any errors in the debug log.
UPD www.devco.net/archives/2009/08/19/tips_and_tricks_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question