新来的厨师。
设法使用这示例创建google实例,甚至删除它们。
(1..2).each do |i|
# <name of cookbook>_instance will lead to instance.rb . weird.
google_cloud_instance "#{name_prefix}-#{i}" do
machine_type 'n1-standard-1'
zone_name "#{zone_a}"
boot_disk_image "debian-7-wheezy-v20140408"
service_account_scopes ["compute", "userinfo.email", "devstorage.full_control"]
tags ["application-server"] # TODO take from metadata
metadata "application-server"=> true, "foo"=>"bar"
auto_restart true
on_host_maintenance "TERMINATE"
# enable turbo mode!
wait_for false
# bootstrap attributes
first_boot_json FIRST_BOOT
client_rb CLIENT_RB
validation_pem VALIDATION_PEM
# auth
client_email AUTH_EMAIL
project_id AUTH_PROJECT
key_location AUTH_KEYPATH
action :create
end
servers << "#{name_prefix}-#{i}"
end在chef-workstation上运行以下代码:
chef-client -z -o 'google_cloud::gce-create-service-server'现在,在我创建的机器上,我想安装软件。例如ruby 2.1,rabbitmq,等等。我要用厨师服务器吗?如果不是,怎么做?如果是,我可以只使用命令行吗?
发布于 2015-12-23 19:07:53
这里不是开始学习厨师的好地方。您的问题的答案是在第一个引导JSON中设置一个run_list键,并使用与您希望服务器执行的操作相对应的方法来运行JSON。
更广泛地说,你应该查看https://learn.chef.io/,开始学习厨师的基础知识,比如烹饪书和食谱。
https://stackoverflow.com/questions/34439989
复制相似问题