mirror of
https://github.com/geerlingguy/mac-dev-playbook
synced 2024-11-22 03:43:06 +00:00
14 lines
502 B
YAML
14 lines
502 B
YAML
---
|
|
- name: See if Dock item {{ item.name | default(item) }} exists.
|
|
ansible.builtin.command: "dockutil --find '{{ item.name }}'"
|
|
register: dockitem_exists
|
|
failed_when: >
|
|
"No such file or directory" in dockitem_exists.stdout
|
|
or "command not found" in dockitem_exists.stdout
|
|
changed_when: false
|
|
tags: ['dock']
|
|
|
|
- name: Ensure Dock item {{ item.name | default(item) }} exists.
|
|
ansible.builtin.command: "dockutil --add '{{ item.path }}'"
|
|
when: dockitem_exists.rc >0
|
|
tags: ['dock']
|