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!!
On Wed, Oct 12, 2011 at 5:37 PM, Jacob Helwig <[email protected]> wrote:
> On Wed, 12 Oct 2011 14:33:47 -0700, John Bower wrote:
> >
> > Hello,
> >
> > I'm trying to share a file between the client and the server.
> >
> > On the server the file is located at: /etc/puppet/modules/mysql-server/
> > files/my.cnf
> >
> > the code that references to this file is as follows:
> >
> > file { "/etc/mysql/my.cnf":
> > source => "puppet:///modules/mysql-server/my.cnf",
> > owner => "mysql", group => "mysql",
> > mode => 644,
> > notify => Service["mysql"],
> > }
> >
> > Essentially, I want the client to store the my.cnf file to /etc/mysq/
> > my.cnf
> >
> > However i keep getting this error:
> > err: /Stage[main]/Mysql-server/File[/etc/mysql/my.cnf]/ensure: change
> > from absent to file failed: Could not set 'file on ensure: No such
> > file or directory - /etc/mysql/my.cnf.puppettmp_9888 at /etc/puppet/
> > modules/mysql-server/manifests/init.pp:15
> >
> >
> >
> > i tried setting source => "puppet:///modules/mysql-server/files/
> > my.cnf",
> >
> >
> > But that did not make a difference. Please help.
> >
>
> Does /etc/mysql exist on the client machine?
>
> --
> Jacob Helwig
>
--
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.