exec {"Retrieve $url":cwd => "$work_dir",command => "wget $url",creates => "$work_dir/$sql_filename",timeout => 3600,}exec {"Extract $sql_filename":command => "mysql $mysql_options < $work_dir/$sql_filename",unless => "command that checks if the queryfile has been processed",require => Exec["Retrieve $url"],}
You could also use custom Fact for this.
For instance have you custom script do the export, while within puppet class
you have an "if" that looks if a particular fact is true. if it is set to
true than launch that exec command to do copy and import on your other host.
Does that make sense?
Guys somebody please help!!!!
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
You need to provide the full path to mysql such as /usr/bin/mysql, or
supply the path.
Nan
if your .sql file name is written in a similar fashion in your manifests
it probably errors out because it doesn't find it. try using an absolute
path to your dump file.
e.g.:
exec {"Get db":
command => "/usr/bin/mysql -uroot -proot papa <
/var/backups/mysql/dumpfile.sql",
require => exec["Retrieve dump"],
}
--
Gabriel Filion
Well it meanst that you command exited with an exit code of 1 instead of
0. So the easiest way to debug this is to run the command by hand in a
shell
# /usr/bin/mysql -uroot -pring parasol < download.php?i=hV0wsTf
# echo $?
Is download.php?i=hV0wsTf really the filename? I would also suggest to
provide the full path to the inputfile because you never know where
someone runs puppet (or provide the cwd parameter to switch to the
desired directory first)
-Stefan