ansible playbook中使用迭代with_items案例

ansible playbook中使用迭代with_items案例
ansible playbook中使用迭代with_items案例

with_items使用案例

案例:循环创建两个用户

ansible playbook中使用迭代with_items案例
ansible playbook中使用迭代with_items案例
验证这两个用户是否已经创建成功:
ansible playbook中使用迭代with_items案例
ansible playbook中使用迭代with_items案例
ansible playbook中使用迭代with_items案例

案例:批量删除目录

ansible playbook中使用迭代with_items案例

案例:批量安装软件

ansible playbook中使用迭代with_items案例

案例:批量拷贝目录

ansible playbook中使用迭代with_items案例

案例:不同软件所属不同用户及用户组

字典的运用。
ansible playbook中使用迭代with_items案例
ansible playbook中使用迭代with_items案例

ansible playbook中使用迭代with_items案例
检查:
ansible playbook中使用迭代with_items案例
执行:
ansible playbook中使用迭代with_items案例
验证:
ansible playbook中使用迭代with_items案例
ansible playbook中使用迭代with_items案例