ansible Ansible: Looping with_items - simple list


Example

A with_items loop in ansible can be used to easily loop over values.

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