mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
homebrew_cask: reinstall when force is install option (#4090)
* homebrew_cask: reinstall when force is install option * add changelog entry * Fix OSX CI runs - run as non-root * test with cask that has no macos dependencies * use `brooklyn` cask to test
This commit is contained in:
parent
2ec37702de
commit
8b95c56030
5 changed files with 87 additions and 1 deletions
|
@ -102,6 +102,12 @@ EXAMPLES = '''
|
|||
state: present
|
||||
install_options: 'debug,appdir=/Applications'
|
||||
|
||||
- name: Install cask with force option
|
||||
community.general.homebrew_cask:
|
||||
name: alfred
|
||||
state: present
|
||||
install_options: force
|
||||
|
||||
- name: Allow external app
|
||||
community.general.homebrew_cask:
|
||||
name: alfred
|
||||
|
@ -600,7 +606,7 @@ class HomebrewCask(object):
|
|||
self.message = 'Invalid cask: {0}.'.format(self.current_cask)
|
||||
raise HomebrewCaskException(self.message)
|
||||
|
||||
if self._current_cask_is_installed():
|
||||
if '--force' not in self.install_options and self._current_cask_is_installed():
|
||||
self.unchanged_count += 1
|
||||
self.message = 'Cask already installed: {0}'.format(
|
||||
self.current_cask,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue