---
- name: Check for existence of zsh.
  command: "which zsh"
  register: zsh_exists
  failed_when: "'{{ zsh_path }}' not in zsh_exists.stdout"
  always_run: true

- name: Check if /etc/shells already contians zsh.
  lineinfile:
    dest: "/etc/shells"
    line: "{{ zsh_path }}"
  always_run: true
  become: true

- name: Set zsh shell as default if specified.
  command: "chsh -s {{ zsh_path }}"
  when: "{{ make_zsh_default_shell|bool }}"
  always_run: true
  become: true

# Install oh-my-zsh

---
- name: Check for existence of zsh.
  command: "which zsh"
  register: zsh_exists
  failed_when: "'{{ zsh_path }}' not in zsh_exists.stdout"
  always_run: true

- name: Check if /etc/shells already contians zsh.
  lineinfile:
    dest: "/etc/shells"
    line: "{{ zsh_path }}"
  always_run: true
  become: true

- name: Set zsh shell as default if specified.
  command: "chsh -s {{ zsh_path }}"
  when: "'{{ make_zsh_default_shell|bool }}' is true"
  always_run: true
  become: true

# Install oh-my-zsh

Make another stab at setting default shell
Make another stab at setting default shell
