Skip to content

Commit 46c85e7

Browse files
committed
feat(homebrew): Add option to upgrade all casks
1 parent 9e24c73 commit 46c85e7

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

roles/homebrew/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ Packages you would like to make sure are _uninstalled_.
3838

3939
Whether to upgrade homebrew and all packages installed by homebrew. If you prefer to manually update packages via `brew` commands, leave this set to `false`.
4040

41+
42+
homebrew_cask_upgrade_all_packages: false
43+
44+
Whether to upgrade homebrew and all cask applications installed by homebrew. If you prefer to manually update packages via `brew` commands, leave this set to `false`.
45+
4146
homebrew_taps:
4247
- homebrew/core
4348
- { name: my_company/internal_tap, url: 'https://example.com/path/to/tap.git' }

roles/homebrew/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ homebrew_installed_packages: []
1010
homebrew_uninstalled_packages: []
1111

1212
homebrew_upgrade_all_packages: false
13+
homebrew_cask_upgrade_all_packages: false
1314

1415
homebrew_taps:
1516
- homebrew/core

roles/homebrew/tasks/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@
136136
notify:
137137
- Clear homebrew cache
138138

139+
- name: Upgrade all cask applications (if configured).
140+
homebrew_cask:
141+
install_options: "{{ item.install_options | default('appdir=' + homebrew_cask_appdir) }}"
142+
accept_external_apps: "{{ homebrew_cask_accept_external_apps }}"
143+
sudo_password: "{{ ansible_become_password | default(omit) }}"
144+
update_homebrew: true
145+
upgrade_all: true
146+
greedy: true
147+
when: homebrew_cask_upgrade_all_packages
148+
notify:
149+
- Clear homebrew cache
150+
139151
# Brew.
140152
- name: Ensure blacklisted homebrew packages are not installed.
141153
homebrew: "name={{ item }} state=absent"

0 commit comments

Comments
 (0)