Closed CultClassik closed 4 years ago
You are right, I added update_cache: yes
about a month ago and forget about MacOS.
I think that should be a separated task for update cache. Something like this:
- name: Update package cache
package:
update_cache: yes
when: ansible_os_family != 'Darwin'
- name: Install zsh, git, wget
package:
name:
- zsh
- git
- wget
state: present
# brew don't work from root user on macOS
when: not (zsh_user == 'root' and ansible_os_family == 'Darwin')
Please try it on MacOS, you can send PR, or I will make commit in next week.
Thanks, I finally had time to test this. I submitted PR #48 for this issue.
FAILED! => {"changed": false, "msg": "Unsupported parameters for (homebrew) module: update_cache Supported parameters include: install_options, name, path, state, update_homebrew, upgrade_all"}
Removing this option from the package module in install.yml fixes the issue:
update_cache: yes
OSX Catalina, Homebrew 2.4.1, Ansible 2.9.10
I would be happy to submit a PR but I am fairly new to Ansible. Would the best approach be adding a brew package module call when os == Darwin, and using the existing package module when os != Darwin?