---

- name: Update homebrew
  command: brew update
  tags:
    - base
    - brew
    - update

- name: Install brew-cask
  command: "{{ brew_cask_install }}"
  args:
    creates: "{{ brew_cask_bin }}"
  tags:
    - base
    - brew
    - brew-cask

- name: Install base homebrew packages
  homebrew:
    name={{ item.name }}
    install_options={{ item.install_options | default("") }}
  with_items: brew_base_packages
  tags:
    - base
    - brew

- name: Install brew cask applications
  homebrew_cask:
    name={{ item.name }}
    state={{ item.state | default("present") }}
  with_items: brew_cask_applications
  tags:
    - base
    - brew
    - brew-cask

- name: Cleanup cask
  command: brew-cask cleanup
  tags:
    - base
    - brew
    - brew-cask

- name: Link homebrew apps
  command: brew linkapps
  tags:
    - base
    - brew
    - brew-cask

- name: ssh dir
  file:
    path={{ home_dir }}/.ssh
    state=directory
  tags:
    - base

- name: Project workspace
  file:
    path={{ workspace_dir }}
    state=directory
  tags:
    - base

- name: User tmp dir
  file:
    path="{{ home_dir }}/tmp"
    state=directory
  tags:
    - base

---

- name: Update homebrew
  homebrew: update_homebrew=yes
  tags:
    - base
    - brew
    - update

- name: Install brew-cask
  command: "{{ brew_cask_install }}"
  args:
    creates: "{{ brew_cask_bin }}"
  tags:
    - base
    - brew
    - brew-cask

- name: Install base homebrew packages
  homebrew:
    name={{ item.name }}
    install_options={{ item.install_options | default("") }}
  with_items: brew_base_packages
  tags:
    - base
    - brew

- name: Install brew cask applications
  homebrew_cask:
    name={{ item.name }}
    state={{ item.state | default("present") }}
  with_items: brew_cask_applications
  tags:
    - base
    - brew
    - brew-cask

- name: Cleanup cask
  command: brew-cask cleanup
  tags:
    - base
    - brew
    - brew-cask

- name: Link homebrew apps
  command: brew linkapps
  tags:
    - base
    - brew
    - brew-cask

- name: ssh dir
  file:
    path={{ home_dir }}/.ssh
    state=directory
  tags:
    - base

- name: Project workspace
  file:
    path={{ workspace_dir }}
    state=directory
  tags:
    - base

- name: User tmp dir
  file:
    path="{{ home_dir }}/tmp"
    state=directory
  tags:
    - base

Use homebrew module update command
Use homebrew module update command
