---
# tasks file for qb.git_repo

- name: initialize git
  command: git init
  args:
    chdir: "{{ git_repo_dest }}"
    creates: "{{ git_repo_dest }}/.git"

- name: Tell Git to ignore OSX artifacts 
  when: ansible_distribution == "MacOSX"
  include_role:
    name: qb.gitignore
  vars:
    gitignore_name: Global/macOS
    gitignore_dest: "{{ git_repo_dest }}"

- name: Tell Git to ignore QB artifacts
  include_role:
    name: qb.gitignore
  vars:
    gitignore_name: QB
    gitignore_dest: "{{ git_repo_dest }}"

- name: >-
    Tell Git to ignore each of <git_repo_gitignores>
  with_items: "{{ git_repo_gitignores }}"
  loop_control:
    loop_var: name
  include_role:
    name: qb.gitignore
  vars:
    gitignore_name: "{{ name }}"
    gitignore_dest: "{{ git_repo_dest }}"

---
# tasks file for qb.git_repo

- name: >-
    Create {{ git_repo_dest }} directory
  file:
    dest: >-
      {{ git_repo_dest }}
    state: directory

- name: >-
    Initialize git
  command: git init
  args:
    chdir: >-
      {{ git_repo_dest }}
    creates: >-
      {{ git_repo_dest }}/.git

- name: >-
    Tell Git to ignore OSX artifacts 
  when: ansible_distribution == "MacOSX"
  include_role:
    name: qb.gitignore
  vars:
    gitignore_name: Global/macOS
    gitignore_dest: >-
      {{ git_repo_dest }}

- name: >-
    Tell Git to ignore QB artifacts
  include_role:
    name: qb.gitignore
  vars:
    gitignore_name: QB
    gitignore_dest: >-
      {{ git_repo_dest }}

- name: >-
    Tell Git to ignore each of <git_repo_gitignores>
  with_items: >-
    {{ git_repo_gitignores }}
  loop_control:
    loop_var: name
  include_role:
    name: qb.gitignore
  vars:
    gitignore_name: >-
      {{ name }}
    gitignore_dest: >-
      {{ git_repo_dest }}

Fix git_repo to create dest dir if doesn't exists.
Fix git_repo to create dest dir if doesn't exists.
