---
# Plugin install tasks.

- name: Ensure `.janus` directory exists for each user.
  file:
    path: "{{ janus_plugin_install_path }}"
    state: directory
    owner: "{{ janus_user.name }}"
    group: "{{ janus_user.group }}"

- name: Clone plugin repos to `.janus` directory for each user.
  git:
    repo: "{{ plugin.url }}"
    dest: "{{ janus_plugin_install_path }}/{{ plugin.name }}"
    force: "{{ plugin.force | default(false) }}"
    # Note: this deviation in code style necessitated by a weird Ansible bug:
    # https://git.io/fN1Tc
    update: "{{ plugin['update'] | default(true) }}"
    version: "{{ plugin.version | default('HEAD') }}"
  with_items: "{{ janus_vim_plugins }}"
  loop_control:
    loop_var: plugin

- name: Set file ownership of plugin directory.
  file:
    path: "{{ janus_plugin_install_path }}"
    state: directory
    owner: "{{ janus_user.name }}"
    group: "{{ janus_user.group }}"
    recurse: true
  changed_when: false

Include file to allow for Vim plugin installation
Include file to allow for Vim plugin installation
