---
- name: install zsh
  homebrew:
    name: zsh
    state: present

- name: install oh-my-zsh
  git:
    repo: https://github.com/robbyrussell/oh-my-zsh
    dest: "{{ webdev_dotfiles_home }}.oh-my-zsh"

- name: add zsh to available shells
  lineinfile:
    dest: /etc/shells
    line: "{{ webdev_homebrew_rootpath }}bin/zsh"
    state: present

- name: set permissions
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ webdev_dotfiles_user }}"
    group: "{{ webdev_dotfiles_group }}"
    mode: u=rwX,g=rX,o=rX
    recurse: yes
  with_items:
    - "{{ webdev_dotfiles_home }}.oh-my-zsh"

- name: copy dotfiles
  template:
    src: "{{ item }}"
    dest: "{{ webdev_dotfiles_home }}{{ item | basename | regex_replace('.j2','') }}"
    owner: "{{ webdev_dotfiles_user }}"
    group: "{{ webdev_dotfiles_group }}"
    mode: u=rwX,g=rX,o=rX
  with_fileglob:
    - ../templates/.*.j2
    - ../templates/*.j2

---
- name: install zsh
  homebrew:
    name: zsh
    state: present

- name: install oh-my-zsh
  git:
    repo: https://github.com/robbyrussell/oh-my-zsh
    dest: "{{ webdev_dotfiles_home }}.oh-my-zsh"

- name: add zsh to available shells
  lineinfile:
    dest: /etc/shells
    line: "{{ webdev_homebrew_rootpath }}bin/zsh"
    state: present

- name: set default shell
  user:
    name: "{{ webdev_dotfiles_user }}"
    group: 'staff'
    groups: 'com.apple.sharepoint.group.1,everyone,localaccounts,_appserverusr,admin,_appserveradm,_lpadmin,_appstore,_lpoperator,_developer,com.apple.access_ftp,com.apple.access_screensharing,com.apple.access_ssh'
    shell: /bin/zsh

- name: set permissions
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ webdev_dotfiles_user }}"
    group: "{{ webdev_dotfiles_group }}"
    mode: u=rwX,g=rX,o=rX
    recurse: yes
  with_items:
    - "{{ webdev_dotfiles_home }}.oh-my-zsh"

- name: copy dotfiles
  template:
    src: "{{ item }}"
    dest: "{{ webdev_dotfiles_home }}{{ item | basename | regex_replace('.j2','') }}"
    owner: "{{ webdev_dotfiles_user }}"
    group: "{{ webdev_dotfiles_group }}"
    mode: u=rwX,g=rX,o=rX
  with_fileglob:
    - ../templates/.*.j2
    - ../templates/*.j2

Set default shell to zsh
[FEATURE] Set default shell to zsh
