Hello, Am 16.03.2009 um 16:16 schrieb TomTom:
> I am trying to puppetize a multi-mysql installation. Our mysql > consultant suggested that we use the pre-compiled binary installations > from mysql.com. > So a multi-instance mysql installation would look like > /data01/multi_mysql/mysql_A/ > /data01/multi_mysql/mysql_B/ > /data01/multi_mysql/mysql_C/ > > First of all, my puppet definition below tries to do the untar first, > and doesn't try to create the file system. I don't think I have my > require order correct. How can I fix that. Not sure what the tarextrat {} does, but wouldn't it be enough to require => Exec["some_alias"] (I'd pop in an alias => "some_alias" in the exec)? > Second of all, when I try to run the second mysql_B installation, > puppet borks and says: > puppetd[23415]: Could not retrieve configuration: Duplicate > definition: File[/data01/multi_mysql] is already defined in file /etc/ > puppet/manifests/definitions/dba/mysql_instance.pp at line 76; cannot > redefine at /etc/puppet/manifests/definitions/dba/mysql_instance.pp:76 > > I believe puppet is getting hung up on the "idempotency" (Not sure if > I am using this word correctly) > Puppet is seeing the file definition when the function is called to > install the second instance, and is saying that the definition is > previously defined. Does anyone know how to get around this. Try a virtual resource http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#virtual-resources . Basically, you define the resource somewhere outside the define, but it won't do anything on its own. You then put the realize function in the definition, which will make the resource do something if it's called at least once, but it won't bother puppet if the realize is called more than once. > My > instance installation class is: > define mysql_install_definition ( > $data_dir, $mysql_instance, $mysql_distro > ) { > $wget = "wget -q" > $build_area = "/usr/local/puppet" > > #data_dir should be there before this gets started > #file { "/$data_dir": > # mode => 775, owner => "mysql", group => "sysadmin", > # } > > file { "/$data_dir/multi_mysql": > mode => 775, owner => "mysql", group => "sysadmin", > require => File [ "/$data_dir" ], > } > > file { "/$data_dir/multi_mysql/$mysql_instance": > mode => 775, owner => "mysql", group => "sysadmin", > require => File [ "/$data_dir/multi_mysql" ], > } > > file { "/$data_dir/log": > mode => 775, owner => "mysql", group => > "sysadmin", > require => File [ "/$data_dir" ], > } > > file { "/$data_dir/log/$mysql_instance": > mode => 775, owner => "mysql", group => > "sysadmin", > require => File [ "/$data_dir/log" ], > } > > exec { "wget -q ftp://$server_local/depot/precompiled/ > $mysql_distro": > cwd => "$build_area/KITS", > creates => "$build_area/KITS/${mysql_distro}", > require => [File [ "$build_area/KITS" ], File [ "/ > $data_dir/multi_mysql/$mysql_instance" ]], > } > > tarextract { "$buld_area/KITS/$mysql_distro": > source => "$build_area/KITS/$mysql_distro", > directory => "/$data_dir/multi_mysql/ > $mysql_instance", > newfile => "INSTALL-BINARY", > uid => "mysql", > gid => "sysadmin", > compression => "gzip", > } > }#end of mysql_install define Peace, Felix Schäfer --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---