hello guys,

 I am trying to incorporate run stages into my puppet setup. I've been
working with this for a few days and I haven't quite got the hang of
it yet...


  When I attempt my puppet run this is the error I see:

------------------------------------------------

[root@chromews21 ~]# puppetd -t
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Duplicate definition: Class[Centos] is already defined; cannot
redefine at /etc/puppet/manifests/nodes.pp:28 on node
chromews21.example.net
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run



Which is confusing because I was under the impression that under 2.6
the class / stage relationship basically takes the place of 'include
foo' where foo is a class you want to use.

------------------------------------------

 Just to step you through my logic, I define my stages in site.pp (so
that they will be applied everywhere):

import "template"
import "nodes"
import "classes/*"
import "groups/*"
import "users/*"
import "os/*"

 # site.pp
   file { "/etc/sudoers":
           owner => root, group => root, mode => 440
   }

filebucket { main: server => puppet }
File { backup => main }

 stage {"os": before => Stage["main"]}
 stage {"repos": before => Stage["main"]}
 stage {"last": require  => Stage["main"]}


------------------------------------------------------

 This is the relationship I setup in template.pp


--------------------------------------------------------

 node basenode {

    case $operatingsystem {
        centos: { include centos }
        ubuntu: { include ubuntu }
        default: { include centos }
    }
    include baseapps, sshd

}

node default inherits basenode {}

node webserver inherits basenode {
  ## <-- I used to define 'include apache' here
}

node dbserver inherits basenode {
     include mysql
}

node mailserver inherits basenode {
     include postfix
}


-----------------------------------------------------------------

And then this is how I define my client that I am working with:


-----------------------------------------------------------------


node 'chromews21.acadaca.net' inherits webserver {      ## <-- instead
what I attempt to do is setup the stage relationships here
       class {"centos": stage => os}
       class {"yumrepos": stage => repos}
       class {"baseapps": stage => main}
       class {"basefiles": stage => main}
       class {"apache": stage => last}
}



-------------------------------------------------------------------------------------------



So obviously I am not trying to redefine the centos class. I am merely
trying to setup a precedence in terms of how the software is
installed.


Thanks in advance for your help!

-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to