循环控制语句 之 with_dict

- hosts: all
  tasks:
  - name: debug
    debug:
      msg: "{{ item.key }} 的名字叫 {{ item.value.name }}"
    with_dict:
    - user01:
        name: zhangsan
        age: 30
    - user02:
        name: lisi
        age: 30
posted @ 2023-01-20 09:31  mingtian是吧  阅读(16)  评论(0编辑  收藏  举报