I would like to use dockutil spacers with ansible, but it doesn't seem to be possible to get the status of a spacer, nor "label" them.
dockutil --add '' --type spacer --section apps --after 'Activity Monitor' --label 'spacer1'
# None of these work
dockutil --find spacer1
dockutil --find ''
For idempotency purposes, first I check if the spacer exists, and if not, add it. The current workaround is to remove all spacers and re add them with each ansible playbook run.
For comparison, I'm doing the following for apps:
- name: Add all to dock
shell: dockutil --find '{{ item.name }}' || dockutil --add '{{ item.path }}' --label '{{ item.name }}'
register: dockutil_add
changed_when: "'was found in' not in dockutil_add.stdout"
with_items: "{{ dock_persistent_apps }}"
This would only add an app if --find fails, and mark as changed if "was not found in" exists in the output.
Additionally, following-up on #31 , it would also be great if there was a way to move spacers like we do for apps, as an alternative of using --after flag:
Hi,
I would like to use dockutil spacers with ansible, but it doesn't seem to be possible to get the status of a spacer, nor "label" them.
For idempotency purposes, first I check if the spacer exists, and if not, add it. The current workaround is to remove all spacers and re add them with each ansible playbook run.
For comparison, I'm doing the following for apps:
This would only add an app if
--find
fails, and mark as changed if "was not found in" exists in the output.Additionally, following-up on #31 , it would also be great if there was a way to move spacers like we do for apps, as an alternative of using
--after
flag:dockutil:
v3.1.3
Thank you for your work!