--- - name: Install dockutil. homebrew: name: dockutil state: present notify: - Clear homebrew cache - name: Remove configured Dock items. ansible.builtin.include_tasks: tasks/dock-remove.yml loop: "{{ dockitems_remove }}" - name: Ensure required dock items exist. ansible.builtin.include_tasks: tasks/dock-add.yml loop: "{{ dockitems_persist }}" - name: Ensure correct Dock order. ansible.builtin.command: cmd: dockutil --move '{{ item.name }}' --position '{{ item.pos }}' when: - item.pos is defined - item.pos > 0 loop: "{{ dockitems_persist }}"