---
- name: Ensure that the Homebrew directories exists
  file:
    path: "{{ item }}"
    state: directory
    mode: 0775
    owner: "{{ homebrew_user }}"
    group: admin
    recurse: False
  become: yes
  with_items:
    - /usr/local/bin
    - /usr/local/Homebrew
    - /usr/local/var
    - /usr/local/var/homebrew

- name: Install Homebrew via git
  git:
    repo: https://github.com/Homebrew/brew.git
    dest: /usr/local/Homebrew
    version: master
    force: True
    clone: True
    update: False

- name: Ensure symlink for brew exists
  file:
    src: ../Homebrew/bin/brew
    dest: /usr/local/bin/brew
    state: link
    force: True
  become: True

- name: Udate Homebrew
  homebrew: update_homebrew=yes
  become: False

---
- name: Ensure that the Homebrew directories exists
  file:
    path: "{{ item }}"
    state: directory
    mode: 0775
    owner: "{{ homebrew_user }}"
    group: admin
    recurse: False
  become: yes
  with_items:
    - /usr/local/bin
    - /usr/local/sbin
    - /usr/local/Homebrew
    - /usr/local/var
    - /usr/local/var/homebrew
    - /usr/local/Cellar
    - /usr/local/Frameworks
    - /usr/local/opt
    - /usr/local/etc
    - /usr/local/share
    - /usr/local/lib
    - /usr/local/include

- name: Install Homebrew via git
  git:
    repo: https://github.com/Homebrew/brew.git
    dest: /usr/local/Homebrew
    version: master
    force: True
    clone: True
    update: False

- name: Ensure symlink for brew exists
  file:
    src: ../Homebrew/bin/brew
    dest: /usr/local/bin/brew
    state: link
    force: True
  become: True

- name: Udate Homebrew
  homebrew: update_homebrew=yes
  become: False

Create all direcotries required by Homebrew
Create all direcotries required by Homebrew
