---
- name: Dotfiles - Clone common dotfiles repo
  git:
    repo: "{{ dotfiles['common_url'] }}"
    dest: "{{ dotfiles['common_target'] }}"
    recursive: yes

- name: Dotfiles - Run common dotfiles installer
  command: "{{ dotfiles['common_target'] }}/install"

  #- name: Dotfiles - Clone local dotfiles repo
  #  git:
  #    repo: "{{ dotfiles['local_url'] }}"
  #    dest: "{{ dotfiles['local_target'] }}"
  #    recursive: yes
  #
  #- name: Dotfiles - Run local dotfiles installer
  #  command: "{{ dotfiles['local_target'] }}/install"

- name: Dofiles - Set ZDOTDIR
  become: true
  lineinfile:
    dest: /etc/zsh/zshenv
    regexp: ^ZDOTDIR=
    line: ZDOTDIR=$HOME/.config/zsh

---
- name: Dotfiles - Clone common dotfiles repo
  git:
    repo: "{{ dotfiles['common_url'] }}"
    dest: "{{ dotfiles['common_target'] }}"
    recursive: yes
  when: dotfiles['common_url'] is defined

- name: Dotfiles - Run common dotfiles installer
  command: "{{ dotfiles['common_target'] }}/install"

- name: Dotfiles - Clone local dotfiles repo
  git:
    repo: "{{ dotfiles['local_url'] }}"
    dest: "{{ dotfiles['local_target'] }}"
    recursive: yes
  when: dotfiles['local_url'] is defined

- name: Dotfiles - Run local dotfiles installer
  command: "{{ dotfiles['local_target'] }}/install"
  when: dotfiles['local_url'] is defined

- name: Dofiles - Set ZDOTDIR
  become: true
  lineinfile:
    dest: /etc/zsh/zshenv
    regexp: ^ZDOTDIR=
    line: ZDOTDIR=$HOME/.config/zsh

Enable installation of local dotfiles
Enable installation of local dotfiles
