Hello list!!
Your help is invaluable and genuinely appreciated!! Here is the
manifest as things stand now:
class dbservices {
class postgres {
$pgapps = ["postgresql84-server","postgresql84"]
package { $pgapps: ensure => installed }
user { "postgres:":
uid => 26,
ensure => present
}
group { "postgres":
gid => 26,
ensure => present
}
$preqs =
['User["postgres"]','Group["postgres"]','Package["postgresql84-server"]']
# Initialize the postgres db
exec {"initialize-pgsql":
environment => ["USER=postgres"],
command => "/sbin/service postgresql initdb",
creates => "/var/lib/pgsql/data",
require => Package["postgresql84-server"],
loglevel => debug
}
service { postgresql:
name => postgresql,
enable => true,
hasstatus => true,
ensure => running,
require => Package["postgresql84-server"],
loglevel => debug
}
}
class mysql {
$mysqlapps = ["mysql-server","mysql","php-mysql"]
package { $mysqlapps: ensure => installed }
user { "mysql":
uid => 27,
ensure => present
}
group { "mysql":
gid => 27,
ensure => present
}
$mreqs = ['User["mysql"]','Group["mysql"]','Package["mysql-server"]']
service { mysqld:
name => mysqld,
enable => true,
hasstatus => true,
ensure => running,
require => $mreqs,
loglevel => debug
}
}
}
With my nodes setup as such:
node 'pclient.acadaca.net' {
include basefiles
include baseapps
include dbservices::mysql
include dbservices::postgres
}
node 'pclient2.acadaca.net' {
include basefiles
include baseapps
include dbservices::mysql
include dbservices::postgres
}
node 'pclient3.acadaca.net' {
include basefiles
include baseapps
include dbservices::mysql
include dbservices::postgres
}
node 'mclient.acadaca.net'{
include basefiles
include baseapps
include webservices
}
Which results in the following run on the client:
[root@pclient3 ~]# puppetd --test
info: Caching catalog for pclient3.acadaca.net
err: Could not run Puppet configuration client: Could not find
dependency User["mysql"] for Service[mysqld] at
/etc/puppet/manifests/classes/dbservices.pp:57
For some reason the mysql user isn't being created. I really feel as
if I am close to a solution to this problem and I really appreciate
any further input you may have!
Tim
On Fri, Feb 25, 2011 at 11:31 AM, jcbollinger <[email protected]> wrote:
>
>
> On Feb 24, 10:52 am, Tim Dunphy <[email protected]> wrote:
>> Also I should have mentioned that both services start by hand with an
>> exit code of 0 (echo $?)
>
> Do the dbserver scripts depend on something else environmental, such
> as some other service being up? The network service springs to mind
> as a possible example, though if the network were down then your node
> should not be able to obtain its catalog from the Pupeptmaster.
>
> If you start the services by hand, then shut them down, then perform a
> Puppet run, do the service startups still fail? If so, can you
> thereafter still start them by hand?
>
> Is there any chance that the failures arise because the services are
> already running? An LSB-conformant initscript will exit with an error
> code (probably 1) if asked to start a service that is already
> running. If your initscripts support the "status" command, then your
> service declarations should include hasstatus => true to make Puppet
> use it. If not, then you may need use the "status" property to tell
> Puppet how to recognize whether the services are running. Without
> either, Puppet has to fall back to looking in the process list, which
> is error-prone.
>
>
> John
>
> --
> 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.
>
>
--
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.