【发布时间】:2020-07-28 23:49:16
【问题描述】:
我是否可以延迟在 AWS OpsWorks 中运行的整个厨师食谱?
我试图执行睡眠命令但没有成功:
Chef::Log.info("Delaying chef execution")
execute 'delay' do
command 'sleep 60'
end
我想要实现的是根据我进行延迟的位置来延迟配方中的所有 Ruby 代码,可能在顶部,也可能在中间。
编辑:完整的厨师食谱:
Chef::Log.info("stopping service rsyslog")
service 'rsyslog' do
action :stop
end
Chef::Log.info("configuring private ip addresses for mesos_master templates")
ruby_block "configuring_mesos_master_templates" do
# Do stuff
end
Chef::Log.info("starting service rsyslog")
service 'rsyslog' do
action :start
end
Chef::Log.info("restarting service zookeeper")
service 'zookeeper' do
action :restart
end
Chef::Log.info("restarting service mesos-master")
service 'mesos-master' do
provider Chef::Provider::Service::Upstart
action :restart
end
Chef::Log.info("starting service marathon")
service 'marathon' do
action :start
end
【问题讨论】:
标签: ruby shell chef-infra