On Wed, 12 Oct 2011 17:49:20 -0400, olympus stance wrote:
> 
> Hi Jacob,
> 
> My init.pp file is a symbolic link to the mysql-server.pp in the classes
> directory. It looks like this:
> 
> -------
> class mysql-server {
> 
>   package { "mysql-server": ensure => installed }
>   package { "mysql-client": ensure => installed }
>   service { "mysql":
>              enable => false,
>              require => Package["mysql-server"],
>           }
> 
>   file { "/etc/mysql/my.cnf":
>     source => "puppet:///modules/mysql-server/my.cnf",
>     owner => "mysql", group => "mysql",
>     mode  => 644,
>     notify => Service["mysql"],
>   }
> 
> 
> 
>   exec { "run-mysqld":
>     path => ["/bin", "/usr/sbin"],
>     command => "/usr/sbin/mysqld &",
>   }
> 
>   exec { "set-mysql-password":
>     path => ["/bin", "/usr/bin"],
>     command => "mysqladmin -uroot password secret",
>   }
> 
> 
>   exec { "set-nagios-password":
>     path => ["/bin", "/usr/bin"],
>     command => "/usr/bin/mysql -u root  -e \"CREATE USER 'nagios'@'%'
> IDENTIFIED BY 'secret';\"",
>   }
> 
> 
> }
> ---------------------------
> 
> 
> It looks like it does indeed try to create the my.cnf file before mysql gets
> installed. How can i rectify that
> 
> Thanks!!
> 

You'll need to add a 'require => ...' to the /etc/mysql/my.cnf
file resource.  Either to another file resource that creates /etc/mysql,
or to the mysql-server package resource.

File resources don't automatically create the parent directories of the
things they manage.

-- 
Jacob Helwig

Attachment: signature.asc
Description: Digital signature

Reply via email to