2011-10-28 38 views
0

我希望能夠在一個地方配置(可以用Ruby編寫代碼)。由於不同的配置(比如bash腳本)不理解Ruby,我不得不預先填充它們。有沒有一個易於使用的工具? 我找到了ruby-parseconfig但這並不是我要找的。把Ruby配置放到非ruby配置中

回答

0

看起來你可以用chef templates來做到這一點。

實施例:

# 
# /etc/sudoers 
# 
# Generated by Chef for <%= node[:fqdn] %> 
# 

Defaults  !lecture,tty_tickets,!fqdn 

# User privilege specification 
root   ALL=(ALL) ALL 

<% @sudoers_users.each do |user| -%> 
<%= user %> ALL=(ALL) <%= "NOPASSWD:" if @passwordless %>ALL 
<% end -%>