requested changes

This commit is contained in:
dspolleke 2021-04-12 17:37:55 +02:00 committed by Paul van Noort
parent 63659ca41e
commit 5b47a103ce
3 changed files with 42 additions and 44 deletions

View file

@ -6,29 +6,31 @@ configure_terminal: false
configure_osx: true configure_osx: true
configure_dock: [] configure_dock: []
configure_dock: true configure_dock: false
dockitems_to_remove: dockitems_to_remove: []
- Launchpad # Example: to remove all / some items added by default on Big Sur uncomment use example below
- Safari # dockitems_to_remove:
- Messages # - Launchpad
- Mail # - Safari
- Maps # - Messages
- Photos # - Mail
- FaceTime # - Maps
- Calendar # - Photos
- Contacts # - FaceTime
- Reminders # - Calendar
- Notes # - Contacts
- TV # - Reminders
- Music # - Notes
- Podcasts # - TV
- 'App Store' # - Music
remove_spacers: true # - Podcasts
# - 'App Store'
dockitems_to_persist: dockitems_to_persist:
- name: iTerm
path: "/Applications/iTerm.app/"
- name: "Google Chrome" - name: "Google Chrome"
path: "/Applications/Google Chrome.app/" path: "/Applications/Google Chrome.app/"
- name: "Sublime Text"
path: "/Applications/Sublime Text.app/"
configure_sudoers: false configure_sudoers: false
sudoers_custom_config: '' sudoers_custom_config: ''
# Example: # Example:

View file

@ -48,7 +48,7 @@
executable: "{{ item.executable | default(omit) }}" executable: "{{ item.executable | default(omit) }}"
loop: "{{ gem_packages }}" loop: "{{ gem_packages }}"
- include_tasks: tasks/dock.yml - import_tasks: tasks/dock.yml
when: configure_dock when: configure_dock
tags: ['dock'] tags: ['dock']

View file

@ -1,26 +1,22 @@
--- ---
- name: ensure dock items - name: Install dockutil
block:
- name: Install dockutil
homebrew: homebrew:
name: dockutil name: dockutil
state: present state: present
notify: notify:
- Clear homebrew cache - Clear homebrew cache
- name: remove dockitems - name: remove dockitems
ansible.builtin.include_tasks: tasks/remdock.yml ansible.builtin.include_tasks: tasks/remdock.yml
loop: "{{ dockitems_to_remove }}" loop: "{{ dockitems_to_remove }}"
- name: Ensure required dock items exist. - name: Ensure required dock items exist.
ansible.builtin.include_tasks: tasks/adddock.yml ansible.builtin.include_tasks: tasks/adddock.yml
with_items: "{{ dockitems_to_persist }}" with_items: "{{ dockitems_to_persist }}"
- name: Ensure correct dock order - name: Ensure correct dock order
ansible.builtin.command: ansible.builtin.command:
cmd: dockutil --move '{{ item.name }}' --position '{{ item.pos }}' cmd: dockutil --move '{{ item.name }}' --position '{{ item.pos }}'
when: when:
- item.pos is defined - item.pos is defined
- item.pos length >0 - item.pos length >0
loop: "{{ dockitems_to_persist }}" loop: "{{ dockitems_to_persist }}"
tags: ['dock']