The way I solved this was using a conditional execute like this :
execute "seed database" do
cwd node[:release_path]
user node[:owner]
environment ({'RAILS_ENV' => node[:environment]})
command "bundle exec rake db:seed && touch #{node[:deploy_path]}/db.seeded"
not_if { ::File.exists?("#{node[:deploy_path]}/db.seeded") }
end
This makes sure a setup step only happens once.