Ansible: Appending items to a List: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

13 March 2024

  • curprev 20:3720:37, 13 March 2024Ebasso talk contribs 703 bytes +703 Created page with "Simple task to append items to a list <nowiki> - name: Append items to a list hosts: localhost gather_facts: false vars: mylist: [] tasks: - name: Append list with additional mapping ansible.builtin.set_fact: mylist: "{{ mylist + [{'name': 'blabla', 'mode': 1}] }}" - name: Append list with additional mapping ansible.builtin.set_fact: mylist: "{{ mylist + [{'name': 'yoyoyo', 'mode': 2}] }}" - name: Print the updated..."