On Tuesday, May 26, 2015 at 8:15:43 AM UTC-5, jcbollinger wrote: > > > > On Friday, May 22, 2015 at 3:34:11 PM UTC-5, Joe Koenig wrote: >> >> Hi all, >> >> I'm trying to learn puppet and am running into a roadblock trying to get >> an agent to pickup its configuration from a master server. On master, I >> have created a class called 'lamp': >> >> [x@master manifests]# pwd >> >> /etc/puppet/modules/lamp/manifests >> >> [x@master manifests]# ls -l >> >> total 4 >> >> -r--r--r--. 1 puppet puppet 1014 May 21 22:06 init.pp >> >> > Well, *perhaps* you created a class called "lamp". All you actually show > is that you created the file in which Puppet will look for the definition > of such a class. > > > > >> On my agent, I run: >> >> sudo puppet agent --test --noop --debug >> >> The output is (note, I changed the valid FQDN to 'fqdn' in the log >> entries): >> [many ordinary debug-level messages, but no mention of a class "lamp"] >> > > > Supposing that you really did create a class "lamp", it will be applied > only to those nodes to which you assign it. There is a variety of ways to > perform a class assignment, but they fall into two main categories: using > an external node classifier (ENC), or declaring it either directly or > indirectly via the node's environment's starting-point manifest. If you > have not done this then your class will not be applied to any node. > > Additionally, you may be running into an issue with Puppet's environment > cache. Unless you affirmatively disable caching (thereby accepting a > performance penalty) it's safest to restart the master after changing your > manifest set to ensure that the changes are recognized right away. > Thanks for the response. It looks like Google was trimming part of my original post (see trimmed content above for more log, too). I have the code that exists in the init.pp above, along with the error log entry:
*Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class lamp for web-agent-1.fqdn on node web-agent-1.fqdn* *Warning: Not using cache on failed catalog* *Error: Could not retrieve catalog; skipping run* For simplicity, the 'lamp' class contains this: class lamp { exec { 'yum-update': # exec resource named 'yum-update' command => '/usr/bin/yum update -y' # command this resource will run } # install apache2 package package { 'apache2': require => Exec['yum-update'], # require 'apt-update' before installing ensure => installed, } # ensure apache2 service is running service { 'apache2': ensure => running, } # install mysql-server package package { 'mariadb-server': require => Exec['yum-update'], # require 'apt-update' before installing ensure => installed, } # ensure mysql service is running service { 'mysql': ensure => running, } # install php5 package package { 'php5': require => Exec['yum-update'], # require 'apt-update' before installing ensure => installed, } # ensure info.php file exists file { '/var/www/html/info.php': ensure => file, content => '<?php phpinfo(); ?>', # phpinfo code require => Package['apache2'], # require 'apache2' package before creating } } --------- I'm fully expecting issues with that class, which I can debug once I'm able to get puppet to locate it, and I am ultimately planning on converting it over to use existing modules to handle things like apache/php install, etc., but I wanted to try my hand at it in order to get a good feel of how/what puppet does. To me, the error seems to indicate that it is successfully identifying the node in the site.pp file, but it's just not able to locate that lamp class. I did try turning off cache and restarting the master, both to no avail. Any help would be much appreciated. Thanks, Joe -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/50e2140d-f91c-4c0e-853f-06e93c8daf39%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.