ansible 學習記錄(六) -- 條件判斷

Condition When

---

- name: test when condition
  hosts: localhost
  gather_facts: no

  vars:
    seq:
      - 1
      - 2
      - 3
      - 4
      - 5

  tasks:
    - name: test loop and when
      debug:
        msg: "{{ item }}"
      with_items: "{{ seq }}"
      when: item >= 3
[root@master ~]# ansible-playbook /home/ansible-study/playbook/condition/when.yml

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章