2021-04-12 11:29:34 +00:00
|
|
|
---
|
2021-05-27 16:44:43 +00:00
|
|
|
- name: See if dock item {{ item }} exists.
|
2021-04-12 11:29:34 +00:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: dockutil --find '{{ item }}'
|
|
|
|
register: dockitem_exists
|
|
|
|
changed_when: false
|
2021-05-27 16:44:43 +00:00
|
|
|
failed_when: >
|
|
|
|
"No such file or directory" in dockitem_exists.stdout
|
|
|
|
or "command not found" in dockitem_exists.stdout
|
2021-04-12 11:29:34 +00:00
|
|
|
tags: ['dock']
|
2021-04-12 11:49:12 +00:00
|
|
|
|
2021-05-27 16:44:43 +00:00
|
|
|
- name: Ensure Dock item {{ item }} is removed.
|
2021-04-12 11:29:34 +00:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: dockutil --remove '{{ item }}'
|
|
|
|
when: dockitem_exists.rc == 0
|
|
|
|
tags: ['dock']
|