Hey guys,

 I've made a little progress I'd like to report. I was able to get
part of the dbservices manifest to work. But with the manifest written
this way postgresql installs and mysql does not. i am not sure why
that might be the case:

class dbservices {


  $pgapps = [ "postgresql84-server","postgresql84" ]

     package { $pgapps:
               ensure => installed }

class postgres {

       package { $pgapps: ensure  => installed }

       service { postgresql:
                 name  => postgresql,
                 enable => true,
                 ensure => running
    }

}


class  mysql {

       $mysqlapps = [ "mysql-server","mysql","php-mysql" ]

       package { $mysqlapps: ensure  => installed }

       service { mysqld:
                 name  => mysqld,
                 enable => true,
                 ensure => running
       }

   }

}


AFAIK it should be ok to include two or more classes in one outer
(wrapper) class in your manifest files.


When this didn't work as hoped I then rewrote the manifest as one big class.


class dbservices {


   $pgapps = [ "postgresql84-server","postgresql84" ]
   package { $pgapps: ensure  => installed }



       service { postgresql:
                 name  => postgresql,
                 enable => true,
                ensure => running
    }




   $mysqlapps = [ "mysql-server","mysql","php-mysql" ]
   package { $mysqlapps: ensure  => installed }




       service { mysqld:
                 name  => mysqld,
                 enable => true,
                 ensure => running
       }

}


And when I did that I got this error reporting that the services could
not be started:


[root@pclient ~]# puppetd --test
info: Caching catalog for pclient.acadaca.net
info: Applying configuration version '1298504233'
err: //dbservices/Service[mysqld]/ensure: change from stopped to
running failed: Could not start Service[mysqld]: Execution of
'/sbin/service mysqld start' returned 1:  at
/etc/puppet/manifests/classes/dbservices.pp:28
err: //dbservices/Service[postgresql]/ensure: change from stopped to
running failed: Could not start Service[postgresql]: Execution of
'/sbin/service postgresql start' returned 1:  at
/etc/puppet/manifests/classes/dbservices.pp:13
notice: Finished catalog run in 6.76 seconds


Now, what has me really curious at this point are these two things
I've mentioned. Why would it be that I can only have one or the other
of the postgres or mysql classes function the way the first manifest
is written? Also why if I take everything and put it into one big
class the way I did in the second manifest will the services not
start? Someone in IRC speculated that the services can't start because
the apps are not present when puppet attempts to start them. I'm
having some trouble seeing why that would be the case the way these
are written.


My nodes are pretty simple in this test environment:

node 'pclient.acadaca.net' { include dbservices }
node 'mclient.acadaca.net'{ include webservices }

However we hope to roll puppet out to production sometime in the next
couple of weeks assuming we can get these issues ironed out.


thanks in advance!!





On Wed, Feb 23, 2011 at 4:32 PM, Tim Dunphy <[email protected]> wrote:
> hey guys
>
>  I have two manifests that I setup to apply to different types of
> machines. one is a webservices class that goes like this
>
> class webservices {
>
>    $webapps = [ "php-common","php","httpd" ]
>    package { $webapps: ensure => installed }
>
>    service { httpd:
>                 name  => httpd,
>                 enable => true,
>                 ensure => running,
>                 hasstatus => true
>               }
>
>
>
> }
>
>
>
> The above works.. when I run puppetd --test on the machine acting as
> the webserver  these apps are installed
>
> However for the dbservices manifest which looks like this:
>
>
> class dbservices {
>
>
>  $pgapps = [ "postgresql84-server","postgresql84" ]
>
>     package { $pgapps:
>               ensure => installed }
>
> class postgres {
>
>       package { $pgapps: ensure  => installed }
>
>       service { postgresql:
>                 name  => postgresql,
>                 enable => true,
>                 ensure => running
>    }
>
> }
>
>
> class  mysql {
>
>       $myapps = [ "mysql-server","mysql" ]
>
>       package { $myapps: ensure  => installed }
>
>       service { mysqld:
>                 name  => mysqld,
>                 enable => true,
>                 ensure => running
>       }
>
>   }
>
> }
>
> Running puppetd --test on the host functioning as the database server
> these apps are not installed.
>
> And I have my nodes setup like this:
>
> node 'pclient.acadaca.net' { include dbservices }
> node 'mclient.acadaca.net'{ include webservices }
>
>
> Can I get some advice on getting this to work?
>
> thanks!!
>
>
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>



-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

debug: Puppet::Type::User::ProviderUser_role_add: file rolemod does not 
exist
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Puppet::Type::User::ProviderLdap: true value when expecting 
false
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl 
does not exist
debug: Failed to load library 'ldap' for feature 'ldap'
debug: /File[/var/lib/puppet/ssl/public_keys/pclient.acadaca.net.pem]: 
Autorequiring File[/var/lib/puppet/ssl/public_keys]
debug: /File[/var/lib/puppet/state/graphs]: Autorequiring 
File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/ssl/private_keys/pclient.acadaca.net.pem]: 
Autorequiring File[/var/lib/puppet/ssl/private_keys]
debug: /File[/var/lib/puppet/clientbucket]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/client_yaml]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/facts]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring 
File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/ssl/certs/pclient.acadaca.net.pem]: 
Autorequiring File[/var/lib/puppet/ssl/certs]
debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/classes.txt]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/state]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/run/puppet/puppetd.pid]: Autorequiring 
File[/var/run/puppet]
debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/lib]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring 
File[/var/lib/puppet/ssl/certs]
debug: /File[/etc/puppet/puppet.conf]: Autorequiring 
File[/etc/puppet]
debug: Finishing transaction 23456293229180 with 0 changes
debug: /File[/var/lib/puppet/ssl/public_keys/pclient.acadaca.net.pem]: 
Autorequiring File[/var/lib/puppet/ssl/public_keys]
debug: /File[/var/lib/puppet/state]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/facts]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/private]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring 
File[/var/lib/puppet/ssl/certs]
debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring 
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/private_keys/pclient.acadaca.net.pem]: 
Autorequiring File[/var/lib/puppet/ssl/private_keys]
debug: /File[/var/lib/puppet/lib]: Autorequiring 
File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/certs/pclient.acadaca.net.pem]: 
Autorequiring File[/var/lib/puppet/ssl/certs]
debug: Finishing transaction 23456294133380 with 0 changes
debug: Using cached certificate for ca
debug: Using cached certificate for pclient.acadaca.net
debug: Finishing transaction 23456293461040 with 0 changes
debug: Loaded state in 0.00 seconds
debug: Using cached certificate for ca
debug: Using cached certificate for pclient.acadaca.net
debug: Using cached certificate_revocation_list for ca
debug: catalog supports formats: b64_zlib_yaml marshal pson raw yaml; 
using pson
debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm 
--version'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm 
--version'
debug: Puppet::Type::Package::ProviderAptrpm: Executing '/bin/rpm -ql 
rpm'
debug: Puppet::Type::Package::ProviderUrpmi: Executing '/bin/rpm -ql 
rpm'
info: Caching catalog for pclient.acadaca.net
debug: Puppet::Type::Group::ProviderPw: file /usr/sbin/pw does not 
exist
debug: Puppet::Type::Group::ProviderLdap: true value when expecting 
false
debug: Puppet::Type::Group::ProviderDirectoryservice: file /usr/bin/dscl 
does not exist
debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude 
does not exist
debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not 
exist
debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does 
not exist
debug: Puppet::Type::Package::ProviderUp2date: file 
/usr/sbin/up2date-nox does not exist
debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not 
exist
debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not 
exist
debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does 
not exist
debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does 
not exist
debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not 
exist
debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not 
exist
debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not 
exist
debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not 
exist
debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info 
does not exist
debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall 
does not exist
debug: Puppet::Type::Package::ProviderPorts: file 
/usr/local/sbin/portupgrade does not exist
debug: Creating default schedules
debug: Finishing transaction 23456293421000 with 0 changes
debug: Loaded state in 0.00 seconds
debug: Prefetching yum resources for package
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm 
--version'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -qa 
--nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} %{ARCH}
''
debug: //File[/etc/sudoers]: Autorequiring Group[root]
info: Applying configuration version '1298500800'
debug: //Group[webalizer]: Not tagged with dbservices
debug: //Group[nfsnobody]: Not tagged with dbservices
debug: //Group[distcache]: Not tagged with dbservices
debug: //Group[bin]: Not tagged with dbservices
debug: //Group[named]: Not tagged with dbservices
debug: //Group[ais]: Not tagged with dbservices
debug: //Group[dovecot]: Not tagged with dbservices
debug: //Group[mysql]: Not tagged with dbservices
debug: //Group[summitnjops]: Not tagged with dbservices
debug: //Group[pegasus]: Not tagged with dbservices
debug: //Group[squid]: Not tagged with dbservices
debug: /Schedule[weekly]: Not tagged with dbservices
debug: //Group[haldaemon]: Not tagged with dbservices
debug: //Group[nscd]: Not tagged with dbservices
debug: /Filebucket[puppet]: Not tagged with dbservices
debug: //Group[utempter]: Not tagged with dbservices
debug: //Group[floppy]: Not tagged with dbservices
debug: //Group[root]: Not tagged with dbservices
debug: //File[/etc/sudoers]: Not tagged with dbservices
debug: //Group[ricci]: Not tagged with dbservices
debug: //Group[postfix]: Not tagged with dbservices
debug: //Group[piranha]: Not tagged with dbservices
debug: //Group[dbus]: Not tagged with dbservices
debug: //Group[slocate]: Not tagged with dbservices
debug: /Schedule[daily]: Not tagged with dbservices
debug: //Group[postdrop]: Not tagged with dbservices
debug: //Group[ldapuser]: Not tagged with dbservices
debug: //Group[daemon]: Not tagged with dbservices
debug: //Group[man]: Not tagged with dbservices
debug: //Group[audio]: Not tagged with dbservices
debug: //Group[uucp]: Not tagged with dbservices
debug: //Group[users]: Not tagged with dbservices
debug: //Group[rpc]: Not tagged with dbservices
debug: //Group[apache]: Not tagged with dbservices
debug: //Group[nobody]: Not tagged with dbservices
debug: /Schedule[monthly]: Not tagged with dbservices
debug: //Group[vcsa]: Not tagged with dbservices
debug: //Group[kmem]: Not tagged with dbservices
debug: //Group[lp]: Not tagged with dbservices
debug: //Group[adm]: Not tagged with dbservices
debug: //Group[screen]: Not tagged with dbservices
debug: //Group[mem]: Not tagged with dbservices
debug: //Group[dip]: Not tagged with dbservices
debug: //Group[mailnull]: Not tagged with dbservices
debug: //Group[rpcuser]: Not tagged with dbservices
debug: //Group[utmp]: Not tagged with dbservices
debug: //Group[games]: Not tagged with dbservices
debug: //Group[ntp]: Not tagged with dbservices
debug: //Group[pcap]: Not tagged with dbservices
debug: //Group[news]: Not tagged with dbservices
debug: /Schedule[never]: Not tagged with dbservices
debug: //Group[mail]: Not tagged with dbservices
debug: //Group[sshd]: Not tagged with dbservices
debug: //Filebucket[main]: Not tagged with dbservices
debug: //Group[ecryptfs]: Not tagged with dbservices
debug: //Group[wheel]: Not tagged with dbservices
debug: //Group[gopher]: Not tagged with dbservices
debug: //Group[sys]: Not tagged with dbservices
debug: //Group[smmsp]: Not tagged with dbservices
debug: //Group[avahi-autoipd]: Not tagged with dbservices
debug: //Group[disk]: Not tagged with dbservices
debug: /Schedule[hourly]: Not tagged with dbservices
debug: //Group[avahi]: Not tagged with dbservices
debug: //Group[ftp]: Not tagged with dbservices
debug: //Group[lock]: Not tagged with dbservices
debug: /Schedule[puppet]: Not tagged with dbservices
debug: //Group[puppet]: Not tagged with dbservices
debug: //Group[tty]: Not tagged with dbservices
debug: Finishing transaction 23456293376640 with 0 changes
debug: Storing state
debug: Stored state in 0.02 seconds
notice: Finished catalog run in 0.30 seconds

Reply via email to