with 專案 - 簡單列表

ansible 中的 with_items 迴圈可用於輕鬆迴圈值。

- name: Add lines to this file
  lineinfile: dest=/etc/file line={{ item }} state=present
  with_items:
    - Line 1
    - Line 2
    - Line 3