mirror of
https://github.com/fscotto/infra.git
synced 2026-09-27 19:03:47 +00:00
Refactor workstation to Fedora WSL target
This commit is contained in:
@@ -25,47 +25,6 @@
|
||||
- "'workstation_dev_fedora' in group_names"
|
||||
- fedora_manage_docker_repo | default(false)
|
||||
|
||||
- name: Configure Google Chrome repository on Fedora
|
||||
tags: [packages]
|
||||
ansible.builtin.yum_repository:
|
||||
name: google-chrome
|
||||
description: Google Chrome
|
||||
baseurl: "https://dl.google.com/linux/chrome/rpm/stable/$basearch"
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
gpgkey: https://dl.google.com/linux/linux_signing_key.pub
|
||||
state: present
|
||||
when:
|
||||
- workstation_manage_google_chrome | default(false)
|
||||
- fedora_manage_google_chrome_repo | default(false)
|
||||
|
||||
- name: Configure Visual Studio Code repository on Fedora
|
||||
tags: [packages, vscode]
|
||||
ansible.builtin.yum_repository:
|
||||
name: vscode
|
||||
description: Visual Studio Code
|
||||
baseurl: https://packages.microsoft.com/yumrepos/vscode
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
gpgkey: https://packages.microsoft.com/keys/microsoft.asc
|
||||
state: present
|
||||
when:
|
||||
- "'workstation_host_linux' in group_names"
|
||||
- fedora_manage_vscode_repo | default(false)
|
||||
|
||||
- name: Configure IntelliJ IDEA COPR repository on Fedora
|
||||
tags: [packages]
|
||||
ansible.builtin.get_url:
|
||||
url: >-
|
||||
https://copr.fedorainfracloud.org/coprs/{{ fedora_intellij_copr_owner }}/{{ fedora_intellij_copr_project }}/repo/fedora-{{ ansible_facts['distribution_major_version'] }}/{{ fedora_intellij_copr_owner }}-{{ fedora_intellij_copr_project }}-fedora-{{ ansible_facts['distribution_major_version'] }}.repo
|
||||
dest: /etc/yum.repos.d/{{ fedora_intellij_copr_owner }}-{{ fedora_intellij_copr_project }}-fedora-{{ ansible_facts['distribution_major_version'] }}.repo
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
when:
|
||||
- "'workstation_host_linux' in group_names"
|
||||
- fedora_manage_intellij_repo | default(false)
|
||||
|
||||
- name: Refresh dnf package metadata
|
||||
tags: [packages]
|
||||
ansible.builtin.dnf:
|
||||
@@ -84,11 +43,6 @@
|
||||
if 'workstation_dev_fedora' in group_names
|
||||
else []
|
||||
)
|
||||
+ (
|
||||
['google-chrome-stable']
|
||||
if workstation_manage_google_chrome | default(false)
|
||||
else []
|
||||
)
|
||||
+ (profile_packages | default([]))
|
||||
+ (
|
||||
(fedora_desktop_packages | default([]))
|
||||
@@ -103,7 +57,7 @@
|
||||
else []
|
||||
)
|
||||
+ (
|
||||
(fedora_workstation_dev_packages | default(workstation_dev_packages | default([])))
|
||||
(fedora_dev_packages | default([]))
|
||||
if 'workstation_dev_fedora' in group_names
|
||||
else []
|
||||
)
|
||||
@@ -112,19 +66,6 @@
|
||||
if 'workstation_dev_wsl' in group_names
|
||||
else []
|
||||
)
|
||||
+ (
|
||||
(workstation_host_linux_packages_fedora | default(workstation_host_linux_packages | default([])))
|
||||
if 'workstation_host_linux' in group_names
|
||||
else []
|
||||
)
|
||||
+ (
|
||||
[fedora_intellij_package_name]
|
||||
if (
|
||||
'workstation_host_linux' in group_names
|
||||
and fedora_manage_intellij_repo | default(false)
|
||||
)
|
||||
else []
|
||||
)
|
||||
+ (host_packages | default([]))
|
||||
)
|
||||
| difference(fedora_excluded_packages | default([]))
|
||||
@@ -139,100 +80,6 @@
|
||||
state: absent
|
||||
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
|
||||
tags: [packages]
|
||||
ansible.builtin.user:
|
||||
@@ -262,11 +109,6 @@
|
||||
(
|
||||
(fedora_flatpak_packages | default([]))
|
||||
+ (host_flatpak_packages | default([]))
|
||||
+ (
|
||||
(workstation_flatpak_packages | default([]))
|
||||
if 'workstation_host_linux' in group_names
|
||||
else []
|
||||
)
|
||||
)
|
||||
| unique
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user