From 4be4c0a719b45672974ed925d9e15bafc5cfff8a Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Fri, 9 May 2025 08:32:29 +0800 Subject: [PATCH] =3 --- inventory/hosts.yml | 7 ++++-- inventory/requirements.yml | 10 +++++++++ plays/install-software.yml | 21 ++++++++++++++++++ plays/provision-guest.yml | 4 ++++ plays/tasks/provisioning/debian.yml | 8 ++----- plays/tasks/software/neovim.yml | 33 +++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 inventory/requirements.yml create mode 100644 plays/tasks/software/neovim.yml diff --git a/inventory/hosts.yml b/inventory/hosts.yml index a21e5ae..8a1b239 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -8,6 +8,7 @@ ungrouped: fern-garden.local: ferngarden-net.local: minecraft.local: + weebill.local: lxc: hosts: @@ -18,16 +19,18 @@ lxc: administration.local: vm: - children: - docker: hosts: #media-share.local: + fern-garden.local: + ferngarden-net.local: + minecraft.local: docker: hosts: fern-garden.local: ferngarden-net.local: minecraft.local: + weebill.local: nfs-client: hosts: diff --git a/inventory/requirements.yml b/inventory/requirements.yml new file mode 100644 index 0000000..745cdf9 --- /dev/null +++ b/inventory/requirements.yml @@ -0,0 +1,10 @@ +roles: + - name: lifeofguenter.resolvconf + - name: hussainweb.chezmoi + - name: gikeymarcia.neovim + - name: geerlingguy.docker + - name: tomhesse.jellyfin + - name: geerlingguy.nfs + +collections: + - name: hifis.toolkit diff --git a/plays/install-software.yml b/plays/install-software.yml index 3f94332..a25d2fd 100644 --- a/plays/install-software.yml +++ b/plays/install-software.yml @@ -3,3 +3,24 @@ become: true roles: - tomhesse.jellyfin + +- hosts: all + become: true + vars: + neovim_prefix_dir: "/usr/local" + neovim_src_dir: "{{ neovim_prefix_dir }}/src/neovim" + neovim_binary_dir: "{{ neovim_prefix_dir }}/bin" + tasks: + - name: Build neovim + import_tasks: ./tasks/software/neovim.yml + +- hosts: weebill.local + become: true + tasks: + - name: Install Webone dependencies + ansible.builtin.apt: + deb: https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb + - name: Install Webone + ansible.builtin.apt: + update_cache: yes + deb: https://github.com/atauenis/webone/releases/download/v0.17.4/webone.0.17.4.linux-arm64.deb diff --git a/plays/provision-guest.yml b/plays/provision-guest.yml index 83ba59c..3e737d9 100644 --- a/plays/provision-guest.yml +++ b/plays/provision-guest.yml @@ -2,11 +2,15 @@ - hosts: all become: true vars: + treesitter: false + chezmoi_init_url: ssh://git@10.0.1.116:222/fern/dots.git resolv_nameservers: - 10.0.1.1 roles: - lifeofguenter.resolvconf - hifis.toolkit.unattended_upgrades + - hussainweb.chezmoi + - gikeymarcia.neovim tasks: - import_tasks: ./tasks/provisioning/debian.yml diff --git a/plays/tasks/provisioning/debian.yml b/plays/tasks/provisioning/debian.yml index c1ebb1e..a183070 100644 --- a/plays/tasks/provisioning/debian.yml +++ b/plays/tasks/provisioning/debian.yml @@ -30,15 +30,11 @@ - fish - git - libnss-mdns - - neovim - nnn - rsync - sudo - -- name: Add fish nnn quitcd function - ansible.builtin.copy: - src: ./quitcd.fish - dest: /etc/fish/functions/n.fish + - trash-cli + - tmux - name: Make sure avahi-daemon is running systemd_service: diff --git a/plays/tasks/software/neovim.yml b/plays/tasks/software/neovim.yml new file mode 100644 index 0000000..e2075dd --- /dev/null +++ b/plays/tasks/software/neovim.yml @@ -0,0 +1,33 @@ +- name: Install dependencies + apt: + pkg: + - ninja-build + - gettext + - cmake + - unzip + - curl + +- name: Clone neovim repository + ansible.builtin.git: + repo: "https://github.com/neovim/neovim" + dest: "{{ neovim_src_dir }}" + version: stable + clone: yes + update: yes + force: yes + +- name: Check if recently built + ansible.builtin.find: + paths: "{{ neovim_binary_dir }}" + patterns: nvim + age: 1d + register: days + +- name: Build neovim + when: days.matched != '0' + community.general.make: + chdir: "{{ neovim_src_dir }}" + params: + CMAKE_BUILD_TYPE: Release + CMAKE_INSTALL_PREFIX: "{{ neovim_prefix_dir }}" + target: install