mirror of
https://github.com/geerlingguy/mac-dev-playbook
synced 2024-11-21 19:33:03 +00:00
Fixes #112: Dock control tasks skipped if dockutil not installed or not in PATH.
This commit is contained in:
parent
c6fef3ad23
commit
1aebbee720
2 changed files with 10 additions and 6 deletions
|
@ -1,12 +1,14 @@
|
|||
---
|
||||
- name: See if Dock item {{ item }} exists.
|
||||
- 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'
|
||||
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 }} exists.
|
||||
- name: Ensure Dock item {{ item.name | default(item) }} exists.
|
||||
ansible.builtin.command: "dockutil --add '{{ item.path }}'"
|
||||
when: dockitem_exists.rc >0
|
||||
tags: ['dock']
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
---
|
||||
- name: find if dock item exists
|
||||
- name: See if dock item {{ item }} exists.
|
||||
ansible.builtin.command:
|
||||
cmd: dockutil --find '{{ item }}'
|
||||
register: dockitem_exists
|
||||
changed_when: false
|
||||
failed_when: '"No such file or directory" in dockitem_exists.stdout'
|
||||
failed_when: >
|
||||
"No such file or directory" in dockitem_exists.stdout
|
||||
or "command not found" in dockitem_exists.stdout
|
||||
tags: ['dock']
|
||||
|
||||
- name: Ensure unwanted dock items removed.
|
||||
- name: Ensure Dock item {{ item }} is removed.
|
||||
ansible.builtin.command:
|
||||
cmd: dockutil --remove '{{ item }}'
|
||||
when: dockitem_exists.rc == 0
|
||||
|
|
Loading…
Reference in a new issue