2019-07-04 20:58:20 -04:00

9 lines
375 B
Ruby

cookbook_file '/tmp/datacom_abc.sql' do
source 'datacom_abc.sql'
end
execute 'Seed MySQL DB' do
command "mysql -h localhost -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" < /tmp/datacom_abc.sql"
not_if "$(mysql -h 127.0.0.1 -uroot -p\"#{node['db']['root_password']}\" \"#{node['db']['name']}\" -sse \"select count(*) from test_dec;\") -gt 0"
end