I'm looking for some help on defining a priority in my chef recipe.
The recipe is supposed to import a sql dump in a database then execute 2 mysql queries against the database.
I'm using Chef Solo.
The first mysql_database action :query importing the dump works well But the 2 other queries seem to do nothing as it seems that the dump is still importing datas in the DB and the datas are not there when runs. Random execution ?
My recipe:
mysql_database node['wp-dev']['database'] do
connection ({:host => "localhost", :username => 'root',
:password => node['mysql']['server_root_password']})
#NOW THE SQL SCRIPT importing the dump - WORKING
sql { ::File.open("/tmp/database.sql").read }
#NOW THE 2 QUERIES - Not working at first Run
sql "UPDATE WORKING QUERY WHEN COPIED IN MYSQL 1"
sql "UPDATE WORKING QUERY WHEN COPIED IN MYSQL 2"
action :query
end
I can not figure how to fix this or how I can work with only_if to check that the import is finished before running the queries.