On 10/16/2013 04:25 PM, Tensibai wrote:
Bis from mail client bug ...
no problem )
I would use notifications for this use case, something like:
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
notifies :start, "service[apache2]
end
service "apache2" do
action :stop
notifies :run, "bash[bundle_redmine_mylyn]"
end
I has many bundle and rake block in a whole cookbook, which is setting
up redmine entirely
I need a check for security of production server data in during operation.
Because application server runned by apache should be stopeed. Bundle is
not a clear example.
Must clear is rake db:migrate, for example.
Of course now i use in the home of all recipes
service "apache2" do
action :stop
end
And at the end of all code
service "apache2" do
action :start
end
But I think this is not good idea.
More or less from memory so there may be syntax mistakes with
notifications but the idea is there, if action :stop is too much it
may be trigerred by another ressource (a dummy ruby_block just
notyfing or anything else)
The major drawback I see from this way is that it is NOT idempotent
and will do the same again and again at each chef-run if there's not
way to test the install has to be done or not.
Regards,
Tensibai
--
Best regards,
CVision Lab System Administrator
Vladmir Skubriev