Le 2013-10-15 08:22, Vladimir Skubriev a écrit :
How to check that service is stopped, and if not - stop it ? For example in this code block: # See if needed http://stackoverflow.com/questions/14809840/installation-of-redmine-with-bundler-requires-root-password bash "bundle_redmine_mylyn" do cwd "#{node['redmine']['datafs']}/redmine/plugins/redmine_mylyn_connector" user node['apache']['user'] code <<-EOH # We doing source because of interactive shell don't read our .profile source #{node['redmine']['home']}/.rvm/scripts/rvm bundle install EOH end And Can write some not_if's only_if's for example do not_if not_if only_if only_if end ?
I would use notifications for this use case, something like:
service "apache2"
bash "bundle_redmine_mylyn" do cwd "#{node['redmine']['datafs']}/redmine/plugins/redmine_mylyn_connector" user node['apache']['user'] code <<-EOH # We doing source because of interactive shell don't read our .profile source #{node['redmine']['home']}/.rvm/scripts/rvm bundle install EOH
action :nothing end
ruby_block "stop apache" do
Archive powered by MHonArc 2.6.16.