This role automates the use of dockutil
to manage the items in your macOS Dock. You can add, remove, and arrange Dock items.
- Homebrew: Requires
homebrew
already installed (you can usegeerlingguy.mac.homebrew
to install it on your Mac).
Available variables are listed below, along with example values (see defaults/main.yml
):
dockitems_remove: []
Dock items to remove.
dockitems_persist: []
Dock items to add. pos
parameter is optional and will place the Dock item in a particular position in the Dock.
dockutil_install: true
Whether to install dockutil or not. If set to false you'll need to have installed dockutil prior to the execution of this role. See this issue for alternate installation methods, which may be necessary depending on your version of macOS.
- (Soft dependency)
geerlingguy.homebrew
- hosts: localhost
vars:
dockitems_remove:
- Launchpad
- TV
- Podcasts
- 'App Store'
dockitems_persist:
- name: Messages
path: "/Applications/Messages.app/"
- name: Safari
path: "/Applications/Safari.app/"
pos: 2
- name: Sublime Text
path: "/Applications/Sublime Text.app/"
pos: 3
roles:
- geerlingguy.mac.homebrew
- geerlingguy.mac.dock
See the Mac Development Ansible Playbook for an example of this role's usage.
MIT / BSD
This role was created in 2021 by Jeff Geerling, author of Ansible for DevOps.
The contents of this role were originally created by @dspolleke as part of the mac-dev-playbook
.