ruby default.rb

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby default.rb相关的知识,希望对你有一定的参考价值。

#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright (c) 2014 The Authors, All Rights Reserved.
#
package "httpd"

execute "mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.disabled" do 
  only_if do
    File.exist?("/etc/httpd/conf.d/welcome.conf")
  end
  notifies :restart, "service[httpd]"
end

template "/etc/httpd/conf.d/web01.conf" do
  action :create
  owner "root"
  group "root"
  mode "0644"
  source "web01.conf.erb"
  notifies :restart, "service[httpd]"
end

directory "/var/www/html/web01" do
  recursive true
  mode "0755"
end

template "/var/www/html/web01/index.html" do
  action :create
  owner "root"
  group "root"
  mode "0644"
  source "index.html.erb"
  variables(
    :port => 8080
  )
end

template "/etc/httpd/conf.d/web02.conf" do
  action :create
  owner "root"
  group "root"
  mode "0644"
  source "web02.conf.erb"
  notifies :restart, "service[httpd]"
end

directory "/var/www/html/web02" do
  recursive true
  mode "0755"
end

template "/var/www/html/web02/index.html" do
  action :create
  owner "root"
  group "root"
  mode "0644"
  source "index.html.erb"
  variables(
    :port => 8081
  )
end

template "/etc/httpd/conf/httpd.conf" do
  action :create
  owner "root"
  group "root"
  mode "0644"
  source "httpd.conf.erb"
end

template "/var/www/html/index.html" do
  action :delete
  owner "root"
  group "root"
  mode "0644"
  source "index.html.erb"
end

service "httpd" do
  action [:start, :enable]
end

以上是关于ruby default.rb的主要内容,如果未能解决你的问题,请参考以下文章

ruby default.rb

ruby default.rb

ruby default.rb

ruby default.rb

ruby myhaproxy_default.rb

ruby default.rb