47

Ansible的高级用法playbook-Darius

 5 years ago
source link: https://blog.51cto.com/12980155/2384548
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Playbook的核心元素有:Hosts 执行的远程主机列表;Tasks 任务集 ;Varniables 内置变量或自定义变量在playbook中调用;Templates 模板,可替换模板文件中的变量并实现一些简单逻辑的文件;Handlers 和 notity 结合使用,由特定条件触发的操作,满足条件方才执行,否则不执行;tags 标签 指定某条任务执行,用于选择运行playbook中的部分代码。 ansible具有幂等性,因此会自动跳过没有变化的部分,即便如此,有些代码为测试其确实没有发生变化的时间依然会非常地长。此时,如果确信其没有变化,就可以通过tags跳过此些代码片断

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK