为单个 Chef 食谱或资源关闭 verbose_logging

Turn off verbose_logging for single Chef recipes or resources

我有一个将 secret_key 复制到我的节点的方法。实际上文件内容已登录到我的shell。我想为这个单一食谱关闭它,因为我不想将文件内容保存到我的 shell 历史记录中。我知道可以使用 client.rb 中的 verbose_logging 设置完全停用日志记录。

verbose_logging: Set the log level. Options: true, nil, and false. When this is set to false, notifications about individual resources being processed are suppressed (and are output at the :info logging level). Setting this to false can be useful when a chef-client is run as a daemon. Default value: nil.

但是是否可以仅针对单个配方停用日志记录?

有一个叫做sensitivecommon property,它将

Ensure that sensitive resource data is not logged by the chef-client. Default value: false. This property only applies to the execute, file and template resources.

template "/etc/my.secret" do
  sensitive true
end