diff --git a/roles/neovim/tasks/Unix-plugins.yaml b/roles/neovim/tasks/Unix-plugins.yaml deleted file mode 100644 index 1e690b6..0000000 --- a/roles/neovim/tasks/Unix-plugins.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- name: clone plugin repos - git: - repo: 'https://github.com/{{item.repo}}.git' - dest: '{{plugin_dir}}/{{item.mode | default("start")}}/{{item.repo | regex_replace("^.*\/(.*)$", "\1")}}' - version: '{{item.branch | default("HEAD")}}' - with_items: '{{plugins}}' - -- name: get list of managed plugin paths - set_fact: - managed_plugins: >- - {{ - managed_plugins | default([]) + [ - plugin_dir + "/" + - item.mode | default("start") + "/" + - item.repo | regex_replace("^.*\/(.*)$", "\1") - ] - }} - with_items: '{{plugins}}' - -- name: find all installed plugin directories - find: - paths: - - '{{plugin_dir}}/start' - - '{{plugin_dir}}/opt' - file_type: directory - register: found_plugins - -- name: remove found plugins which are not in the managed list - file: - path: '{{item.path}}' - state: absent - with_items: '{{found_plugins.files}}' - when: item.path not in managed_plugins - loop_control: - label: '{{item.path}}' diff --git a/roles/neovim/tasks/Windows-plugins.yaml b/roles/neovim/tasks/Windows-plugins.yaml deleted file mode 100644 index 91f9f78..0000000 --- a/roles/neovim/tasks/Windows-plugins.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- name: clone plugin repos - win_git: - repo: 'https://github.com/{{item.repo}}.git' - dest: '{{plugin_dir}}/{{item.mode | default("start")}}/{{item.repo | regex_replace("^.*\/(.*)$", "\1")}}' - branch: '{{item.branch | default("HEAD")}}' - with_items: '{{plugins}}' - -- name: get list of managed plugin paths - set_fact: - managed_plugins: >- - {{ - managed_plugins | default([]) + [ - plugin_dir + "/" + - item.mode | default("start") + "/" + - item.repo | regex_replace("^.*\/(.*)$", "\1") - ] - }} - with_items: '{{plugins}}' - -- name: find all start plugin directories - win_find: - paths: - - '{{plugin_dir}}/start' - - '{{plugin_dir}}/opt' - file_type: directory - register: found_plugins - -- set_fact: - backslashes: '\\' - forwardslash: '/' -- set_fact: - managed_plugins: "{{managed_plugins | replace(backslashes, forwardslash)}}" - found_plugins: "{{found_plugins | replace(backslashes, forwardslash)}}" - -- name: remove found plugins which are not in the managed list - win_file: - path: '{{item.path}}' - state: absent - with_items: '{{found_plugins.files}}' - when: item.path not in managed_plugins - loop_control: - label: '{{item.path}}' diff --git a/roles/neovim/tasks/Windows.yaml b/roles/neovim/tasks/Windows.yaml index b62118d..0ed96e7 100644 --- a/roles/neovim/tasks/Windows.yaml +++ b/roles/neovim/tasks/Windows.yaml @@ -50,10 +50,3 @@ path: vim_config_tasks.yaml changed_when: false delegate_to: localhost - -- when: ansible_os_family != "Windows" and - plugin_dir is defined and plugins is defined - include_tasks: 'Unix-plugins.yaml' -- when: ansible_os_family == "Windows" and - plugin_dir is defined and plugins is defined - include_tasks: 'Windows-plugins.yaml'