0

我正在学习厨师并遵循#learnchef 教程,特别是 EC2 多节点 EC2 教程。我正在努力理解它在特定部分中的含义。

在第 10 节中,它说:

Next, we need to drop configuration files for Redis, specifically, we need the hostname. We can leverage Chef search for this:

redis_server = search(:node, 'role:redis').first

template "#{node['my_app']['root']}/shared/config/redis.yml" do
  source        'config/redis.yml.erb'
  owner         node['apache']['user']
  group         node['apache']['group']
  mode          '0755'
  variables(
    :host => redis_server['ec2']['local_ipv4']
  )
end

接着,Add the associated template in templates/default/config/redis.yml.erb:

# This file was created by Chef for <%= node['fqdn'] %>
# Do NOT modify this file by hand!

host: "<%= @host %>"

显然我理解后者,但它是什么意思:“删除 Redis 的配置文件”?

我应该以命令的形式运行某些东西还是需要将其放入我的食谱文件中?

4

1 回答 1

1

When they say drop they mean setup the template file in /templates/default/config/redis.yml.erb and allow the Chef recipe to create it on the machine your installing redis.

于 2013-11-25T06:48:28.523 回答