logo
  • 教程列表
  • SO官方文档
  • Ansible 循环
    • 嵌套循环
    • with 项目 - 简单列表
    • with 项目 - 预定义列表
    • with 项目 - 字典
    • with 项目 - 预定义的字典
  1. StackOverflow 文档
  2. Ansible 教程
  3. Ansible 循环
  4. with 项目 - 字典

with 项目 - 字典

Created: November-22, 2018

你可以使用字典来进行稍微复杂的循环。

- name: manage packages
  package: name={{ item.name }} state={{ item.state }}
  with_items:
    - { name: tree, state: present }
    - { name: nmap, state: present }
    - { name: apache2, state: absent }
  • with 项目 - 预定义的字典
  • with 项目 - 预定义列表

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明