ansible 使用哪种条件?
示例
通过(使用语法[brackets])使用条件句:
当[when:]
Task:
-name:runifoperatingsystemisdebian
command:echo"IamaDebianComputer"
when:ansible_os_family=="Debian"
循环[with_items:]
循环[with_dicts:]
自定义事实[时间:my_custom_facts=='1234']
有条件的进口
根据变量选择文件和模板
通过(使用语法[brackets])使用条件句:
当[when:]
Task:
-name:runifoperatingsystemisdebian
command:echo"IamaDebianComputer"
when:ansible_os_family=="Debian"
循环[with_items:]
循环[with_dicts:]
自定义事实[时间:my_custom_facts=='1234']
有条件的进口
根据变量选择文件和模板