diff --git a/group_vars/all/git.yml b/group_vars/all/git.yml index b44e7e1..4715cd3 100644 --- a/group_vars/all/git.yml +++ b/group_vars/all/git.yml @@ -1,8 +1,7 @@ ---- -dotfiles_repo: "git@forgejo.fudiggity.nl:sonny/dotfiles.git" +dotfiles_repo: 'git@forgejo.fudiggity.nl:sonny/dotfiles.git' -git_domain: "forgejo.fudiggity.nl" -git_host_key: "forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+" +git_domain: 'forgejo.fudiggity.nl' +git_host_key: 'forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+' git_name: Sonny Bakker git_email: sonny871@hotmail.com diff --git a/group_vars/all/neovim.yml b/group_vars/all/neovim.yml index 767a4b7..e67edd3 100644 --- a/group_vars/all/neovim.yml +++ b/group_vars/all/neovim.yml @@ -1,51 +1,50 @@ ---- neovim_plugins: - - url: "https://forgejo.fudiggity.nl/sonny/source-link.lua" - name: "source-link" - - url: "https://github.com/nvim-tree/nvim-tree.lua" - name: "nvim-tree" - - url: "https://github.com/nvim-tree/nvim-web-devicons" - name: "nvim-tree-icons" - - url: "https://github.com/neovim/nvim-lspconfig" - name: "nvim-lspconfig" - - url: "https://github.com/hrsh7th/nvim-cmp" - name: "nvim-cmp" - - url: "https://github.com/hrsh7th/cmp-buffer" - name: "cmp-buffer" - - url: "https://github.com/hrsh7th/cmp-path" - name: "cmp-path" - - url: "https://github.com/hrsh7th/cmp-omni" - name: "cmp-omni" - - url: "https://github.com/hrsh7th/cmp-nvim-lsp" - name: "cmp-nvim-lsp" - - url: "https://github.com/hrsh7th/cmp-nvim-lua" - name: "cmp-nvim-lua" - - url: "https://github.com/nvim-treesitter/nvim-treesitter" - name: "nvim-treesitter" + - url: 'https://forgejo.fudiggity.nl/sonny/source-link.lua' + name: 'source-link' + - url: 'https://github.com/nvim-tree/nvim-tree.lua' + name: 'nvim-tree' + - url: 'https://github.com/nvim-tree/nvim-web-devicons' + name: 'nvim-tree-icons' + - url: 'https://github.com/neovim/nvim-lspconfig' + name: 'nvim-lspconfig' + - url: 'https://github.com/hrsh7th/nvim-cmp' + name: 'nvim-cmp' + - url: 'https://github.com/hrsh7th/cmp-buffer' + name: 'cmp-buffer' + - url: 'https://github.com/hrsh7th/cmp-path' + name: 'cmp-path' + - url: 'https://github.com/hrsh7th/cmp-omni' + name: 'cmp-omni' + - url: 'https://github.com/hrsh7th/cmp-nvim-lsp' + name: 'cmp-nvim-lsp' + - url: 'https://github.com/hrsh7th/cmp-nvim-lua' + name: 'cmp-nvim-lua' + - url: 'https://github.com/nvim-treesitter/nvim-treesitter' + name: 'nvim-treesitter' version: master # main seems broken? - - url: "https://github.com/nvim-lua/plenary.nvim" - name: "plenary.nvim" - - url: "https://github.com/nvim-telescope/telescope-fzf-native.nvim" - name: "telescope-fzf-native.nvim" - - url: "https://github.com/nvim-telescope/telescope.nvim" - name: "telescope.nvim" - version: "0.1.x" - - url: "https://github.com/L3MON4D3/LuaSnip" - name: "luasnip" - version: "v1.0.0" - - url: "https://github.com/lewis6991/gitsigns.nvim" - name: "gitsigns.nvim" - version: "v0.9.0" - - url: "https://github.com/nvim-lualine/lualine.nvim" - name: "lualine" - - url: "https://github.com/lukas-reineke/indent-blankline.nvim" - name: "indent-blankline.nvim" - version: "v3.7.2" - - url: "https://github.com/projekt0n/github-nvim-theme.git" - name: "github-colors" - version: "v1.1.2" - - url: "https://github.com/stevearc/conform.nvim.git" - name: "conform.nvim" - version: "v9.0.0" + - url: 'https://github.com/nvim-lua/plenary.nvim' + name: 'plenary.nvim' + - url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim' + name: 'telescope-fzf-native.nvim' + - url: 'https://github.com/nvim-telescope/telescope.nvim' + name: 'telescope.nvim' + version: '0.1.x' + - url: 'https://github.com/L3MON4D3/LuaSnip' + name: 'luasnip' + version: 'v1.0.0' + - url: 'https://github.com/lewis6991/gitsigns.nvim' + name: 'gitsigns.nvim' + version: 'v0.9.0' + - url: 'https://github.com/nvim-lualine/lualine.nvim' + name: 'lualine' + - url: 'https://github.com/lukas-reineke/indent-blankline.nvim' + name: 'indent-blankline.nvim' + version: 'v3.7.2' + - url: 'https://github.com/projekt0n/github-nvim-theme.git' + name: 'github-colors' + version: 'v1.1.2' + - url: 'https://github.com/stevearc/conform.nvim.git' + name: 'conform.nvim' + version: 'v9.0.0' language_servers: [] diff --git a/group_vars/all/system.yml b/group_vars/all/system.yml index d056de1..f57d500 100644 --- a/group_vars/all/system.yml +++ b/group_vars/all/system.yml @@ -1,5 +1,4 @@ ---- -xdg_config_dir: "{{ ansible_env.HOME }}/.config" -xdg_data_dir: "{{ ansible_env.HOME }}/.local/share" +xdg_config_dir: '{{ ansible_env.HOME }}/.config' +xdg_data_dir: '{{ ansible_env.HOME }}/.local/share' packages: [] diff --git a/group_vars/arch/aur.yml b/group_vars/arch/aur.yml index a14af3d..6f1c646 100644 --- a/group_vars/arch/aur.yml +++ b/group_vars/arch/aur.yml @@ -1,41 +1,40 @@ ---- aur_packages: - - url: "https://aur.archlinux.org/nvm.git" - name: "nvm" - package_name: "nvm" - version: "0.40.0-1" - arch: "any" + - url: 'https://aur.archlinux.org/nvm.git' + name: 'nvm' + package_name: 'nvm' + version: '0.40.0-1' + arch: 'any' -aur_build_dir: "/usr/local/src" -python_build_dir: "/usr/local/src" -python_install_dir: "/opt" +aur_build_dir: '/usr/local/src' +python_build_dir: '/usr/local/src' +python_install_dir: '/opt' -python_download_url: "https://www.python.org/ftp/python" +python_download_url: 'https://www.python.org/ftp/python' python_versions: - version: 3.12.9 - path: "python3.12" - binary: "python3.12" + path: 'python3.12' + binary: 'python3.12' - version: 3.11.9 - path: "python3.11" - binary: "python3.11" + path: 'python3.11' + binary: 'python3.11' - version: 3.10.0 - path: "python3.10" - binary: "python3.10" + path: 'python3.10' + binary: 'python3.10' - version: 3.9.14 - path: "python3.9" - binary: "python3.9" + path: 'python3.9' + binary: 'python3.9' - version: 3.8.14 - path: "python3.8" - binary: "python3.8" + path: 'python3.8' + binary: 'python3.8' - version: 3.7.14 - path: "python3.7" - binary: "python3.7" + path: 'python3.7' + binary: 'python3.7' - version: 3.6.15 - path: "python3.6" - binary: "python3.6" + path: 'python3.6' + binary: 'python3.6' diff --git a/group_vars/arch/neovim.yml b/group_vars/arch/neovim.yml index ef6fb27..16b1284 100644 --- a/group_vars/arch/neovim.yml +++ b/group_vars/arch/neovim.yml @@ -1,4 +1,3 @@ ---- language_servers: - package: ansible-language-server server_name: "ansiblels" @@ -26,7 +25,7 @@ language_servers: - package: esbonio server_name: "esbonio" - auto_setup: false + auto_setup: true - package: lua-language-server server_name: "lua_ls" diff --git a/group_vars/arch/system.yml b/group_vars/arch/system.yml index 0de7041..3bab5fb 100644 --- a/group_vars/arch/system.yml +++ b/group_vars/arch/system.yml @@ -1,4 +1,3 @@ ---- packages: - python - git @@ -22,5 +21,3 @@ packages: - which - gcc - make - - esbonio - - marksman diff --git a/group_vars/debian/neovim.yml b/group_vars/debian/neovim.yml index cb53eb6..af2c892 100644 --- a/group_vars/debian/neovim.yml +++ b/group_vars/debian/neovim.yml @@ -1,4 +1,3 @@ ---- # TODO: add lua language server, see https://github.com/LuaLS/lua-language-server? language_servers: - package: "@ansible/ansible-language-server" diff --git a/group_vars/debian/system.yml b/group_vars/debian/system.yml index 2660131..56be4aa 100644 --- a/group_vars/debian/system.yml +++ b/group_vars/debian/system.yml @@ -1,4 +1,3 @@ ---- packages: - python3 - git diff --git a/inventory.yml b/inventory.yml index 5f1897f..7ebdbcf 100644 --- a/inventory.yml +++ b/inventory.yml @@ -1,4 +1,3 @@ ---- personal: hosts: xps: &xps @@ -17,6 +16,7 @@ debian: hosts: fudiggity: <<: *fudiggity + arch: hosts: xps: diff --git a/playbook.yml b/playbook.yml index 3a63d77..8ab70f7 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,4 +1,3 @@ ---- - name: Development provisioning hosts: - personal @@ -7,38 +6,38 @@ pre_tasks: - name: Verifying that a limit is set ansible.builtin.fail: - msg: "This playbook cannot be run with no limit" + msg: 'This playbook cannot be run with no limit' run_once: true when: ansible_limit is not defined - name: Install packages become: true ansible.builtin.package: - name: "{{ item }}" + name: '{{ item }}' state: present - loop: "{{ packages }}" + loop: '{{ packages }}' - name: Add git forge to known hosts ansible.builtin.include_role: name: common - tasks_from: "known_hosts.yml" + tasks_from: 'known_hosts.yml' vars: - user: "{{ ansible_user_id }}" + user: '{{ ansible_user_id }}' items: - - domain: "{{ git_domain }}" - key: "{{ git_host_key }}" + - domain: '{{ git_domain }}' + key: '{{ git_host_key }}' when: ansible_hostname != 'fudiggity' tasks: - name: Setup dotfiles - ansible.builtin.import_tasks: "tasks/dotfiles.yml" + ansible.builtin.import_tasks: 'tasks/dotfiles.yml' tags: dotfiles - name: Include generic neovim tasks - ansible.builtin.import_tasks: "tasks/neovim.yml" + ansible.builtin.import_tasks: 'tasks/neovim.yml' tags: neovim - name: Include debian neovim tasks - ansible.builtin.import_tasks: "tasks/debian/neovim.yml" + ansible.builtin.import_tasks: 'tasks/debian/neovim.yml' when: "'debian' in group_names" tags: neovim @@ -50,23 +49,23 @@ manager: pacman - name: Include arch neovim tasks - ansible.builtin.import_tasks: "tasks/arch/neovim.yml" + ansible.builtin.import_tasks: 'tasks/arch/neovim.yml' when: "'arch' in group_names" tags: neovim - name: Install AUR packages - ansible.builtin.import_tasks: "tasks/arch/aur.yml" + ansible.builtin.import_tasks: 'tasks/arch/aur.yml' tags: aur - name: Setup docker - ansible.builtin.import_tasks: "tasks/arch/docker.yml" + ansible.builtin.import_tasks: 'tasks/arch/docker.yml' tags: docker - name: Setup python versions - ansible.builtin.include_tasks: "tasks/arch/python.yml" - loop: "{{ python_versions }}" + ansible.builtin.include_tasks: 'tasks/arch/python.yml' + loop: '{{ python_versions }}' tags: python - name: Setup NVM - ansible.builtin.import_tasks: "tasks/arch/nvm.yml" + ansible.builtin.import_tasks: 'tasks/arch/nvm.yml' tags: nvm diff --git a/requirements.yml b/requirements.yml index 7a0710c..b20eeb6 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,4 +1,3 @@ ---- - src: git+https://forgejo.fudiggity.nl/sonny/common-ansible.git name: common version: master diff --git a/tasks/arch/aur-package.yml b/tasks/arch/aur-package.yml index 8955b63..e00f8ab 100644 --- a/tasks/arch/aur-package.yml +++ b/tasks/arch/aur-package.yml @@ -1,10 +1,9 @@ ---- - name: Set package directory ansible.builtin.set_fact: - build_dir: "{{ aur_build_dir }}/{{ item.name }}" + build_dir: '{{ aur_build_dir }}/{{ item.name }}' -- name: "Retrieve package name for {{ item.name }}" - ansible.builtin.command: +- name: 'Retrieve package name for {{ item.name }}' + command: argv: - grep - --only-matching @@ -13,8 +12,8 @@ - "{{ build_dir }}/PKGBUILD" register: pkg_name -- name: "Retrieve package version for {{ item.name }}" - ansible.builtin.command: +- name: 'Retrieve package version for {{ item.name }}' + command: argv: - grep - --only-matching @@ -23,8 +22,8 @@ - "{{ build_dir }}/PKGBUILD" register: pkg_version -- name: "Retrieve package release for {{ item.name }}" - ansible.builtin.command: +- name: 'Retrieve package release for {{ item.name }}' + command: argv: - grep - --only-matching @@ -35,20 +34,20 @@ - name: Set package filename & version ansible.builtin.set_fact: - package_filename: "{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-{{ item.arch }}.pkg.tar.zst" + package_filename: '{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-{{ item.arch }}.pkg.tar.zst' installed_version: ansible_facts.packages[item.package_name].version|default('') -- name: "Build package {{ item.name }}" - ansible.builtin.command: "makepkg --syncdeps --rmdeps --clean --noconfirm --force" +- name: 'Build package {{ item.name }}' + ansible.builtin.command: 'makepkg --syncdeps --rmdeps --clean --noconfirm --force' args: - chdir: "{{ build_dir }}" - creates: "{{ build_dir }}/{{ package_filename }}" + chdir: '{{ build_dir }}' + creates: '{{ build_dir }}/{{ package_filename }}' register: package_build when: item.version != installed_version -- name: "Install {{ item.name }}" +- name: 'Install {{ item.name }}' become: true community.general.pacman: - name: "{{ build_dir }}/{{ package_filename }}" + name: '{{ build_dir }}/{{ package_filename }}' state: present when: item.version != installed_version diff --git a/tasks/arch/aur.yml b/tasks/arch/aur.yml index 14ce325..e31aab7 100644 --- a/tasks/arch/aur.yml +++ b/tasks/arch/aur.yml @@ -1,27 +1,26 @@ ---- - name: Retrieve directory stats ansible.builtin.stat: - path: "{{ aur_build_dir }}/{{ item.name }}" - loop: "{{ aur_packages }}" + path: '{{ aur_build_dir }}/{{ item.name }}' + loop: '{{ aur_packages }}' - name: Clone aur packages become: true ansible.builtin.git: - repo: "{{ item.url }}" - dest: "{{ aur_build_dir }}/{{ item.name }}" + repo: '{{ item.url }}' + dest: '{{ aur_build_dir }}/{{ item.name }}' update: true - loop: "{{ aur_packages }}" + loop: '{{ aur_packages }}' - name: Change aur package directories owner become: true ansible.builtin.file: - path: "{{ aur_build_dir }}/{{ item.name }}" + path: '{{ aur_build_dir }}/{{ item.name }}' state: directory - owner: "{{ ansible_user_id }}" - group: "{{ ansible_user_id }}" + owner: '{{ ansible_user_id }}' + group: '{{ ansible_user_id }}' recurse: true - loop: "{{ aur_packages }}" + loop: '{{ aur_packages }}' - name: Build & install aur packages - ansible.builtin.include_tasks: "tasks/arch/aur-package.yml" - loop: "{{ aur_packages }}" + ansible.builtin.include_tasks: 'tasks/arch/aur-package.yml' + loop: '{{ aur_packages }}' diff --git a/tasks/arch/docker.yml b/tasks/arch/docker.yml index fa96d20..c68a81f 100644 --- a/tasks/arch/docker.yml +++ b/tasks/arch/docker.yml @@ -1,8 +1,7 @@ ---- - name: Remove docker mapping files become: true ansible.builtin.file: - path: "{{ item }}" + path: '{{ item }}' state: absent loop: - /etc/subgid @@ -11,38 +10,38 @@ - name: Setup desktop configuration become: true ansible.builtin.file: - path: "files/desktop/docker-daemon.json" - dest: "/etc/docker/daemon.json" - mode: "0755" + path: 'files/desktop/docker-daemon.json' + dest: '/etc/docker/daemon.json' + mode: '0755' when: ansible_hostname == 'desktop' - name: Remove user setup desktop configuration ansible.builtin.file: - path: "{{ xdg_config_dir }}/docker/daemon.json" + path: '{{ xdg_config_dir }}/docker/daemon.json' state: absent when: ansible_hostname == 'desktop' - name: Check for .bashrc.override ansible.builtin.stat: - path: "{{ ansible_env.HOME }}/.bashrc.override" + path: '{{ ansible_env.HOME }}/.bashrc.override' register: bashrc_override - name: Create .bashrc.override ansible.builtin.file: - path: "{{ ansible_env.HOME }}/.bashrc.override" + path: '{{ ansible_env.HOME }}/.bashrc.override' state: touch - mode: "0755" + mode: '0755' when: not bashrc_override.stat.exists - name: Remove rootless DOCKER_HOST variable assignment ansible.builtin.lineinfile: - path: "{{ ansible_env.HOME }}/.bashrc.override" - regexp: "^export DOCKER_HOST=" - line: "" + path: '{{ ansible_env.HOME }}/.bashrc.override' + regexp: '^export DOCKER_HOST=' + line: '' - name: Disable user docker socket ansible.builtin.systemd: - name: "{{ item }}" + name: '{{ item }}' state: stopped enabled: false scope: user diff --git a/tasks/arch/neovim.yml b/tasks/arch/neovim.yml index 6851bbb..0cccfa1 100644 --- a/tasks/arch/neovim.yml +++ b/tasks/arch/neovim.yml @@ -1,7 +1,6 @@ ---- - name: Install language servers become: true community.general.pacman: - name: "{{ item }}" + name: '{{ item }}' state: present loop: '{{ language_servers | map(attribute="package") | list }}' diff --git a/tasks/arch/nvm.yml b/tasks/arch/nvm.yml index 2a29236..b2f2e36 100644 --- a/tasks/arch/nvm.yml +++ b/tasks/arch/nvm.yml @@ -1,16 +1,15 @@ ---- - name: Set NVM install directory ansible.builtin.set_fact: - install_dir: "{{ xdg_config_dir }}/nvm" + install_dir: '{{ xdg_config_dir }}/nvm' - name: Remove manually installed nvm install directory ansible.builtin.file: - path: "{{ install_dir }}" + path: '{{ install_dir }}' state: absent - name: Remove nvm entry from bashrc ansible.builtin.lineinfile: - path: "{{ ansible_env.HOME }}/.bashrc.override" + path: '{{ ansible_env.HOME }}/.bashrc.override' line: > [ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm state: absent diff --git a/tasks/arch/python.yml b/tasks/arch/python.yml index ddc6fb4..72bfbff 100644 --- a/tasks/arch/python.yml +++ b/tasks/arch/python.yml @@ -1,66 +1,65 @@ ---- -- name: "Check for {{ item.binary }} binary" - ansible.builtin.command: "which {{ item.binary }}" +- name: 'check for {{ item.binary }} binary' + command: 'which {{ item.binary }}' changed_when: false failed_when: python_installed.rc not in [ 0, 1 ] register: python_installed -- name: "Check for {{ item.binary }} download" - ansible.builtin.stat: - path: "{{ python_build_dir }}/python-{{ item.version }}.tgz" +- name: 'check for {{ item.binary }} download' + stat: + path: '{{ python_build_dir }}/python-{{ item.version }}.tgz' register: python_download -- when: python_installed.rc not in [ 0 ] - block: +- block: # TODO: verify for checksum - - name: "Retrieve python {{ item.version }} source" + - name: 'retrieve python {{ item.version }} source' become: true - ansible.builtin.get_url: - url: "{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz" - dest: "{{ python_build_dir }}/python-{{ item.version }}.tgz" - owner: "{{ ansible_user_id }}" - group: "{{ ansible_user_id }}" + get_url: + url: '{{ python_download_url }}/{{ item.version }}/Python-{{ item.version }}.tgz' + dest: '{{ python_build_dir }}/python-{{ item.version }}.tgz' + owner: '{{ ansible_user_id }}' + group: '{{ ansible_user_id }}' when: not python_download.stat.exists - - name: "Extract python {{ item.version }} sources" + - name: 'extract python {{ item.version }} sources' become: true - ansible.builtin.unarchive: - src: "{{ python_build_dir }}/python-{{ item.version }}.tgz" - dest: "{{ python_build_dir }}" - include: "Python-{{ item.version }}" + unarchive: + src: '{{ python_build_dir }}/python-{{ item.version }}.tgz' + dest: '{{ python_build_dir }}' + include: 'Python-{{ item.version }}' - - name: Rename source directory + - name: rename source directory become: true - ansible.builtin.command: "mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}" + ansible.builtin.command: 'mv {{ python_build_dir}}/Python-{{ item.version }} {{ python_build_dir }}/{{ item.path }}' - - name: Set correct permissions + - name: set correct permissions become: true - ansible.builtin.file: - path: "{{ python_build_dir }}/{{ item.path }}" + file: + path: '{{ python_build_dir }}/{{ item.path }}' recurse: true - owner: "{{ ansible_user_id }}" - group: "{{ ansible_user_id }}" + owner: '{{ ansible_user_id }}' + group: '{{ ansible_user_id }}' state: directory - - name: Configure build - ansible.builtin.command: "sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}" + - name: configure build + ansible.builtin.command: 'sh ./configure --prefix={{ python_install_dir }}/{{ item.path }}' args: - chdir: "{{ python_build_dir }}/{{ item.path }}/" + chdir: '{{ python_build_dir }}/{{ item.path }}/' - - name: Make build - ansible.builtin.command: "make" + - name: make build + ansible.builtin.command: 'make' args: - chdir: "{{ python_build_dir }}/{{ item.path }}/" + chdir: '{{ python_build_dir }}/{{ item.path }}/' - - name: Install build + - name: install build become: true - ansible.builtin.command: "make install" + ansible.builtin.command: 'make install' args: - chdir: "{{ python_build_dir }}/{{ item.path }}/" + chdir: '{{ python_build_dir }}/{{ item.path }}/' - - name: "Create symlink for python {{ item.version }}" + - name: 'create symlink for python {{ item.version }}' become: true - ansible.builtin.file: - src: "{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}" - dest: "/usr/bin/{{ item.binary }}" + file: + src: '{{ python_install_dir }}/{{ item.path }}/bin/{{ item.binary }}' + dest: '/usr/bin/{{ item.binary }}' state: link + when: python_installed.rc not in [ 0 ] diff --git a/tasks/debian/neovim.yml b/tasks/debian/neovim.yml index a9cd4b4..939a741 100644 --- a/tasks/debian/neovim.yml +++ b/tasks/debian/neovim.yml @@ -1,8 +1,7 @@ ---- - name: Install language servers on debian hosts become: true community.general.npm: - name: "{{ item }}" + name: '{{ item }}' global: true loop: '{{ language_servers | map(attribute="package") | list }}' @@ -10,16 +9,16 @@ become: true ansible.builtin.file: state: directory - path: "{{ neovim.install_path }}" - owner: "{{ ansible_user_id }}" - group: "{{ ansible_user_gid }}" - mode: "0755" + path: '{{ neovim.install_path }}' + owner: '{{ ansible_user_id }}' + group: '{{ ansible_user_gid }}' + mode: '0755' - name: Register the current neovim version ansible.builtin.command: argv: - - "{{ neovim.install_path }}/bin/nvim" - - "--version" + - '{{ neovim.install_path }}/bin/nvim' + - '--version' register: neovim_stats changed_when: false ignore_errors: true @@ -31,21 +30,21 @@ - name: Download neovim {{ neovim.version }} ansible.builtin.get_url: - url: "https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz" + url: 'https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz' dest: /tmp/nvim-linux64.tar.gz - mode: "0755" - checksum: "{{ neovim.download_checksum }}" + mode: '0755' + checksum: '{{ neovim.download_checksum }}' when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version register: neovim_download - name: Extract downloaded neovim version ansible.builtin.unarchive: src: /tmp/nvim-linux64.tar.gz - dest: "{{ neovim.install_path }}" + dest: '{{ neovim.install_path }}' extra_opts: - - "--strip-components=1" - - "--show-stored-names" - - "--overwrite" + - '--strip-components=1' + - '--show-stored-names' + - '--overwrite' when: | neovim_download.state == 'file' and (neovim_installed_version is undefined or neovim_installed_version != neovim.version) @@ -53,6 +52,6 @@ - name: Add neovim to PATH become: true ansible.builtin.template: - src: "templates/debian/nvim.profile.j2" - dest: "/etc/profile.d/neovim.sh" - mode: "0755" + src: 'templates/debian/nvim.profile.j2' + dest: '/etc/profile.d/neovim.sh' + mode: '0755' diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml index 470bda9..b8c40e6 100644 --- a/tasks/dotfiles.yml +++ b/tasks/dotfiles.yml @@ -1,70 +1,69 @@ ---- - name: Clone dotfiles ansible.builtin.git: - repo: "{{ dotfiles_repo }}" - dest: "{{ ansible_env.HOME }}/dotfiles" + repo: '{{ dotfiles_repo }}' + dest: '{{ ansible_env.HOME }}/dotfiles' version: master update: true - name: Create xdg configuration directories ansible.builtin.file: - path: "{{ item }}" + path: '{{ item }}' state: directory - mode: "0755" + mode: '0755' loop: - - "{{ xdg_config_dir }}/git" - - "{{ xdg_config_dir }}/tmux" + - '{{ xdg_config_dir }}/git' + - '{{ xdg_config_dir }}/tmux' - name: Remove previous dotfiles ansible.builtin.file: - path: "{{ item }}" + path: '{{ item }}' state: absent loop: - - "{{ ansible_env.HOME }}/.tmux.conf" - - "{{ ansible_env.HOME }}/.gitconfig" + - '{{ ansible_env.HOME }}/.tmux.conf' + - '{{ ansible_env.HOME }}/.gitconfig' - name: Setup dotfiles ansible.builtin.file: - path: "{{ item.dest }}" - src: "{{ item.src }}" + path: '{{ item.dest }}' + src: '{{ item.src }}' state: link force: true loop: - - src: "{{ ansible_env.HOME }}/dotfiles/.vimrc" - dest: "{{ ansible_env.HOME }}/.vimrc" + - src: '{{ ansible_env.HOME }}/dotfiles/.vimrc' + dest: '{{ ansible_env.HOME }}/.vimrc' - - src: "{{ ansible_env.HOME }}/dotfiles/.bashrc" - dest: "{{ ansible_env.HOME }}/.bashrc" + - src: '{{ ansible_env.HOME }}/dotfiles/.bashrc' + dest: '{{ ansible_env.HOME }}/.bashrc' - - src: "{{ ansible_env.HOME }}/dotfiles/.profile" - dest: "{{ ansible_env.HOME }}/.profile" + - src: '{{ ansible_env.HOME }}/dotfiles/.profile' + dest: '{{ ansible_env.HOME }}/.profile' - - src: "{{ ansible_env.HOME }}/dotfiles/tmux/tmux.conf" - dest: "{{ xdg_config_dir }}/tmux/tmux.conf" + - src: '{{ ansible_env.HOME }}/dotfiles/tmux/tmux.conf' + dest: '{{ xdg_config_dir }}/tmux/tmux.conf' - - src: "{{ ansible_env.HOME }}/dotfiles/tmux/light.conf" - dest: "{{ xdg_config_dir }}/tmux/light.conf" + - src: '{{ ansible_env.HOME }}/dotfiles/tmux/light.conf' + dest: '{{ xdg_config_dir }}/tmux/light.conf' - - src: "{{ ansible_env.HOME }}/dotfiles/tmux/dark.conf" - dest: "{{ xdg_config_dir }}/tmux/dark.conf" + - src: '{{ ansible_env.HOME }}/dotfiles/tmux/dark.conf' + dest: '{{ xdg_config_dir }}/tmux/dark.conf' - - src: "{{ ansible_env.HOME }}/dotfiles/.gitignore" - dest: "{{ xdg_config_dir }}/git/ignore" + - src: '{{ ansible_env.HOME }}/dotfiles/.gitignore' + dest: '{{ xdg_config_dir }}/git/ignore' - name: Copy git configuration ansible.builtin.template: - src: "templates/gitconfig.j2" - dest: "{{ xdg_config_dir }}/git/config" - mode: "0755" + src: 'templates/gitconfig.j2' + dest: '{{ xdg_config_dir }}/git/config' + mode: '0755' - name: Create script directory ansible.builtin.file: - path: "{{ ansible_env.HOME }}/.local/bin" + path: '{{ ansible_env.HOME }}/.local/bin' state: directory - mode: "0755" + mode: '0755' - name: Copy tmux toggle script ansible.builtin.template: - src: "templates/tmux-toggle.j2" - dest: "{{ ansible_env.HOME }}/.local/bin/tmux-toggle.sh" - mode: "0755" + src: 'templates/tmux-toggle.j2' + dest: '{{ ansible_env.HOME }}/.local/bin/tmux-toggle.sh' + mode: '0755' diff --git a/tasks/neovim.yml b/tasks/neovim.yml index 3303d3a..6bdbe68 100644 --- a/tasks/neovim.yml +++ b/tasks/neovim.yml @@ -1,4 +1,3 @@ ---- - name: Ensure neovim configuration directories exist ansible.builtin.file: path: "{{ item }}" diff --git a/templates/nvim/lua/lsp.lua.j2 b/templates/nvim/lua/lsp.lua.j2 index 83c1adc..f9d4202 100644 --- a/templates/nvim/lua/lsp.lua.j2 +++ b/templates/nvim/lua/lsp.lua.j2 @@ -103,12 +103,6 @@ vim.lsp.config['lua_ls'] = { } } --- Use system binary for esbonio -vim.lsp.config['esbonio'] = { - on_attach = on_attach, - capabilities = capabilities, - cmd = { '/usr/bin/esbonio' } -} {% endif %} vim.lsp.config['yamlls'] = { on_attach = on_attach,