Install LazyGit from official release on Fedora WSL

This commit is contained in:
Fabio Scotto di Santolo
2026-08-27 18:57:11 +02:00
parent 3badf14c60
commit 8771fe79c8
2 changed files with 97 additions and 0 deletions

View File

@@ -3,6 +3,9 @@
# alternative application runtimes. # alternative application runtimes.
fedora_excluded_packages: fedora_excluded_packages:
- flatpak - flatpak
- lazygit
fedora_removed_packages: fedora_removed_packages:
- flatpak - flatpak
- snapd - snapd
fedora_manage_lazygit: true
fedora_lazygit_version: 0.64.1

View File

@@ -139,6 +139,100 @@
state: absent state: absent
when: (fedora_removed_packages | default([])) | length > 0 when: (fedora_removed_packages | default([])) | length > 0
- name: Ensure architecture is supported for LazyGit release
tags: [packages]
ansible.builtin.fail:
msg: "Unsupported architecture {{ ansible_facts['architecture'] }} for LazyGit release"
when:
- fedora_manage_lazygit | default(false)
- ansible_facts['architecture'] not in ['x86_64', 'aarch64', 'arm64']
- name: Read installed LazyGit version
tags: [packages]
ansible.builtin.command: /usr/local/bin/lazygit --version
register: fedora_lazygit_version_check
changed_when: false
failed_when: false
check_mode: false
when: fedora_manage_lazygit | default(false)
- name: Ensure temporary LazyGit extraction directory is absent
tags: [packages]
ansible.builtin.file:
path: "/tmp/lazygit_{{ fedora_lazygit_version }}"
state: absent
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Create temporary LazyGit extraction directory
tags: [packages]
ansible.builtin.file:
path: "/tmp/lazygit_{{ fedora_lazygit_version }}"
state: directory
owner: root
group: root
mode: "0755"
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Download LazyGit release archive
tags: [packages]
ansible.builtin.get_url:
url: >-
https://github.com/jesseduffield/lazygit/releases/download/v{{ fedora_lazygit_version }}/lazygit_{{
fedora_lazygit_version }}_Linux_{{
'x86_64' if ansible_facts['architecture'] == 'x86_64'
else 'arm64'
}}.tar.gz
dest: "/tmp/lazygit_{{ fedora_lazygit_version }}.tar.gz"
mode: "0644"
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Extract LazyGit release archive
tags: [packages]
ansible.builtin.unarchive:
src: "/tmp/lazygit_{{ fedora_lazygit_version }}.tar.gz"
dest: "/tmp/lazygit_{{ fedora_lazygit_version }}"
remote_src: true
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Install LazyGit binary
tags: [packages]
ansible.builtin.copy:
src: "/tmp/lazygit_{{ fedora_lazygit_version }}/lazygit"
dest: /usr/local/bin/lazygit
owner: root
group: root
mode: "0755"
remote_src: true
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Remove downloaded LazyGit archive
tags: [packages]
ansible.builtin.file:
path: "/tmp/lazygit_{{ fedora_lazygit_version }}.tar.gz"
state: absent
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Remove temporary LazyGit extraction directory
tags: [packages]
ansible.builtin.file:
path: "/tmp/lazygit_{{ fedora_lazygit_version }}"
state: absent
when:
- fedora_manage_lazygit | default(false)
- fedora_lazygit_version not in (fedora_lazygit_version_check.stdout | default(''))
- name: Add user to docker group - name: Add user to docker group
tags: [packages] tags: [packages]
ansible.builtin.user: ansible.builtin.user: