我正在尝试将 2 个数据包作为变量传递到模板中,但它以错误消息结尾。有谁知道我如何将 2 个数据包传递给模板?
食谱
db = data_bag_item('dbconnect', 'connection')
dbkey = data_bag_item('database', 'databasename')
template '/etc/config.cnf' do
source 'config.cnf.erb'
action :create
variables (
:dbcon => db,
:dbk => dbkey
)
end
模板
connection = mysql://<%= @dbcon['dbuser'] %>:<%= @dbcon['dbpasswd'] %>@<%= @dbcon['dbname'] %>/<%= @dbk['dbname'] %>