Puppet 基础设施与清单优化指南
1. 秘密值管理与 Hiera - EYAML
在 Puppet 中,我们可以修改 site.pp 文件来包含秘密值。具体操作如下:
$top_secret = lookup('top_secret',String,first,'Deja Vu')
notify { "He's The Saint, He's ${top_secret}": }
然后在节点上运行 puppet agent 来查看秘密消息:
[vagrant@testnode ~]$ sudo /opt/puppetlabs/bin/puppet agent -t
执行后会输出类似如下内容:
Info: Caching catalog for testnode.example.com
Info: Applying configuration version '1516687031'
...
Notice: He's The Saint, He's Val Kilmer
Notice: /Stage[main]/Main/Node[default]/Notify[He's The Saint, He's Val Kilmer]/message: defined 'message' as 'He\'s The Saint, He\'s Val Kilmer'
Notice: Applied cat
超级会员免费看
订阅专栏 解锁全文
6

被折叠的 条评论
为什么被折叠?



