Update debian setup

This commit is contained in:
sonny 2024-08-10 16:45:02 +02:00
parent deec1581c5
commit 8f273cc775
3 changed files with 17 additions and 17 deletions

View file

@ -14,8 +14,6 @@
user: '{{ ansible_user_id }}' user: '{{ ansible_user_id }}'
items: items:
- { domain: '{{ gitlab_domain }}', key: '{{ gitlab_host_key }}' } - { domain: '{{ gitlab_domain }}', key: '{{ gitlab_host_key }}' }
roles:
- common
tasks: tasks:
- import_tasks: 'tasks/dotfiles.yml' - import_tasks: 'tasks/dotfiles.yml'
- import_tasks: 'tasks/neovim.yml' - import_tasks: 'tasks/neovim.yml'

View file

@ -150,14 +150,23 @@
} }
- block: - 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: command:
argv: argv:
- '{{ neovim.install_path }}/bin/nvim' - '{{ neovim.install_path }}/bin/nvim'
- '--version' - '--version'
register: neovim_stats register: neovim_stats
ignore_errors: true
- name: parse the current version - name: parse the current neovim version
set_fact: set_fact:
neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)') neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)')
when: neovim_stats.rc == 0 when: neovim_stats.rc == 0
@ -176,17 +185,10 @@
extra_opts: extra_opts:
- '--strip-components=1' - '--strip-components=1'
- '--show-stored-names' - '--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 # TODO: add new entry to PATH
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
when: ansible_facts['os_family'] == 'Debian' when: ansible_facts['os_family'] == 'Debian'

View file

@ -1,12 +1,12 @@
ansible_connection: local ansible_connection: local
ansible_python_interpreter: '/usr/bin/env python' ansible_python_interpreter: '/usr/bin/python3'
packages: packages:
- python3 - python3
- git - git
- vim - vim
- npm - npm
- tree-sitter - libtree-sitter0
- ripgrep - ripgrep
neovim: neovim: