viasite-ansible / ansible-role-zsh

Setup antigen with oh-my-zsh, powerlevel10k theme, fzf, autosuggestions, syntax-highlighting
https://habrahabr.ru/post/323496/
MIT License
347 stars 85 forks source link

Unsupported paramters for (homebrew) module #47

Closed CultClassik closed 4 years ago

CultClassik commented 4 years ago

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?

popstas commented 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.

CultClassik commented 4 years ago

Thanks, I finally had time to test this. I submitted PR #48 for this issue.