diff --git a/debian.yml b/debian.yml index e86c7c1..1125ae0 100644 --- a/debian.yml +++ b/debian.yml @@ -14,8 +14,6 @@ user: '{{ ansible_user_id }}' items: - { domain: '{{ gitlab_domain }}', key: '{{ gitlab_host_key }}' } - roles: - - common tasks: - import_tasks: 'tasks/dotfiles.yml' - import_tasks: 'tasks/neovim.yml' diff --git a/tasks/neovim.yml b/tasks/neovim.yml index 9a3b704..6a98873 100644 --- a/tasks/neovim.yml +++ b/tasks/neovim.yml @@ -150,14 +150,23 @@ } - block: - - name: register the current version + - name: create neovim install directory + become: true + file: + state: directory + path: '{{ neovim.install_path }}' + owner: '{{ ansible_user_id }}' + group: '{{ ansible_user_gid }}' + + - name: register the current neovim version command: argv: - '{{ neovim.install_path }}/bin/nvim' - '--version' register: neovim_stats + ignore_errors: true - - name: parse the current version + - name: parse the current neovim version set_fact: neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)') when: neovim_stats.rc == 0 @@ -176,17 +185,10 @@ extra_opts: - '--strip-components=1' - '--show-stored-names' - when: neovim_download.rc == 0 + - '--overwrite' + when: neovim_download.state == 'file' and + (neovim_installed_version is undefined or neovim_installed_version != neovim.version) - - name: set updated PATH variable - set_fact: - neovim_new_path: '{{ neovim.install_path }}/bin' - - - name: Update PATH to include {{ neovim_new_path }} - ansible.builtin.replace: - path: '~/.profile' - regexp: '^PATH="{{ ansible_env.PATH }}"' - replace: 'PATH="{{ ansible_env.PATH }}:{{ neovim_new_path }}"' - when: neovim_new_path not in ansible_env.PATH + # TODO: add new entry to PATH when: ansible_facts['os_family'] == 'Debian' diff --git a/vars/debian.yml b/vars/debian.yml index 6ccab17..2b3d914 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -1,12 +1,12 @@ ansible_connection: local -ansible_python_interpreter: '/usr/bin/env python' +ansible_python_interpreter: '/usr/bin/python3' packages: - python3 - git - vim - npm - - tree-sitter + - libtree-sitter0 - ripgrep neovim: