From 8bfc8f8fa6f71215bee281724d5e70f52b5e955a Mon Sep 17 00:00:00 2001 From: Paul van Noort Date: Wed, 7 Apr 2021 19:18:39 +0200 Subject: [PATCH] dock --- default.config.yml | 1 + tasks/dock.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tasks/dock.yml diff --git a/default.config.yml b/default.config.yml index c19b001..a3972e3 100644 --- a/default.config.yml +++ b/default.config.yml @@ -4,6 +4,7 @@ downloads: ~/.ansible-downloads/ configure_dotfiles: true configure_terminal: false configure_osx: true +configure_dock: [] configure_sudoers: false sudoers_custom_config: '' diff --git a/tasks/dock.yml b/tasks/dock.yml new file mode 100644 index 0000000..bfcd4c7 --- /dev/null +++ b/tasks/dock.yml @@ -0,0 +1,20 @@ +--- +- name: Install dockutil + homebrew: + name: dockutil + state: present + notify: + - Clear homebrew cache + +- name: Remove all crap from Dock + shell: dockutil --remove '{{ item }}' + ignore_errors: true + with_items: "{{ dockitems_to_remove }}" + +- name: Check if items in dock exist + shell: dockutil --find '{{ item.name }}' || dockutil --add '{{ item.path }}' + with_items: "{{ dockitems_to_persist }}" + +- name: Fix order + shell: dockutil --move '{{ item.name }}' --position '{{ item.pos }}' + with_items: "{{ dockitems_to_persist }}"