Update ego, firefox, intellij, jetbreins, lutris tasks for Arch

This commit is contained in:
Przemysław Grondek 2023-09-22 20:20:14 +02:00
parent 6564f78511
commit 8e2e502f9b
11 changed files with 127 additions and 105 deletions

View File

@ -15,11 +15,12 @@
- laptop - laptop
- desktop - desktop
- backup - backup
- ego
- firefox
- lutris
# - flutter # - flutter
# - virtual # - virtual
# - lutris
# - ego
# - terraform # - terraform
vars: vars:
desktop_src_dir: "{{ ansible_user_dir }}/src/desktop" desktop_src_dir: "{{ ansible_user_dir }}/src/desktop"

View File

@ -1,36 +1,4 @@
--- ---
- name: install required packages for dwm - import_tasks: ubuntu.yml
become: yes when: ansible_distribution == "Ubuntu"
apt:
update_cache: yes
pkg:
- rust-all
- cargo
- libacl1-dev
- x11-xserver-utils
- xdg-desktop-portal-gtk
- name: create src dir
file:
path: ~/src
state: directory
- name: checkout ego
git:
repo: "{{ ego.repo }}"
dest: "{{ desktop_src_dir }}/ego"
clone: yes
update: yes
- name: build ego
command: cargo install ego
args:
chdir: "{{ desktop_src_dir }}/ego"
- name: copy ego
become: yes
copy:
remote_src: true
src: "{{ desktop_src_dir }}/.cargo/bin/ego"
dest: /usr/local/bin/ego
mode: '0755'

View File

@ -0,0 +1,36 @@
---
- name: install required packages for dwm
become: yes
apt:
update_cache: yes
pkg:
- rust-all
- cargo
- libacl1-dev
- x11-xserver-utils
- xdg-desktop-portal-gtk
- name: create src dir
file:
path: ~/src
state: directory
- name: checkout ego
git:
repo: "{{ ego.repo }}"
dest: "{{ desktop_src_dir }}/ego"
clone: yes
update: yes
- name: build ego
command: cargo install ego
args:
chdir: "{{ desktop_src_dir }}/ego"
- name: copy ego
become: yes
copy:
remote_src: true
src: "{{ desktop_src_dir }}/.cargo/bin/ego"
dest: /usr/local/bin/ego
mode: '0755'

View File

@ -3,3 +3,4 @@
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 22 when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 22
- import_tasks: update-alternatives.yml - import_tasks: update-alternatives.yml
when: ansible_distribution == "Ubuntu"

View File

@ -0,0 +1,5 @@
- name: install IntelliJ [AUR]
shell:
cmd:
yay -S --needed --noconfirm \
intellij-idea-ultimate-edition

View File

@ -1,33 +1,3 @@
- name: "Get IntelliJ version" ---
uri: - import_tasks: ubuntu.yml
url: https://data.services.jetbrains.com/products/releases?code=IIU when: ansible_distribution == "Ubuntu"
body_format: json
register: idea_info
- name: "Check if intellij is installed"
stat:
path: "{{idea_dir}}/product-info.json"
register: local_version_info_file
- name: "Check installed version"
when:
- local_version_info_file.stat.exists
shell: cat {{idea_dir}}/product-info.json
register: local_version_info_file
- name: "Set version info fact"
set_fact:
local_intellij_version: "{{ local_version_info_file.stdout | from_json | json_query('version') }}"
upstream_intellij_version: "{{ idea_info.json | json_query('IIU[0].version') }}"
when:
local_version_inf_file is defined
- name: "Set version info fact"
set_fact:
local_intellij_version: "0.0"
upstream_intellij_version: "{{ idea_info.json | json_query('IIU[0].version') }}"
when:
local_version_inf_file is undefined
- import_tasks: install.yml
when: local_version_info_file is undefined or local_intellij_version != upstream_intellij_version

View File

@ -0,0 +1,33 @@
- name: "Get IntelliJ version"
uri:
url: https://data.services.jetbrains.com/products/releases?code=IIU
body_format: json
register: idea_info
- name: "Check if intellij is installed"
stat:
path: "{{idea_dir}}/product-info.json"
register: local_version_info_file
- name: "Check installed version"
when:
- local_version_info_file.stat.exists
shell: cat {{idea_dir}}/product-info.json
register: local_version_info_file
- name: "Set version info fact"
set_fact:
local_intellij_version: "{{ local_version_info_file.stdout | from_json | json_query('version') }}"
upstream_intellij_version: "{{ idea_info.json | json_query('IIU[0].version') }}"
when:
local_version_inf_file is defined
- name: "Set version info fact"
set_fact:
local_intellij_version: "0.0"
upstream_intellij_version: "{{ idea_info.json | json_query('IIU[0].version') }}"
when:
local_version_inf_file is undefined
- import_tasks: install.yml
when: local_version_info_file is undefined or local_intellij_version != upstream_intellij_version

View File

@ -1,9 +1,6 @@
--- ---
- stat:
path: /usr/local/bin/jetbrains-toolbox
register: toolbox_binary
- import_tasks: jetbrains-toolbox.yml - import_tasks: jetbrains-toolbox.yml
when: not toolbox_binary.stat.exists when: ansible_distribution == "Ubuntu"
- import_tasks: system-setup.yml - import_tasks: system-setup.yml
when: ansible_distribution == "Ubuntu"

View File

@ -0,0 +1,5 @@
- name: install lutris
become: yes
community.general.pacman:
name:
- lutris

View File

@ -1,32 +1,6 @@
--- ---
- become: yes - import_tasks: ubuntu.yml
block: when: ansible_distribution == "Ubuntu"
- name: Add i386 Architecture
command: dpkg --add-architecture i386
- name: Update APT Cache for i386 - import_tasks: arch.yml
apt: when: ansible_distribution == "Archlinux"
update_cache: true
- name: remove old ppa repository
apt_repository:
repo: ppa:lutris-team/lutris
state: absent
- name: install lutris libraries
apt:
update_cache: yes
pkg:
- wine
- steam
- name: "Get Lutris version"
uri:
url: https://api.github.com/repos/lutris/lutris/releases/latest
body_format: json
register: git_info
- name: Install deb package
become: yes
apt:
deb: "{{ (git_info.json | json_query('assets[*].browser_download_url') | select('match', '.*deb'))[0] }}"

View File

@ -0,0 +1,32 @@
---
- become: yes
block:
- name: Add i386 Architecture
command: dpkg --add-architecture i386
- name: Update APT Cache for i386
apt:
update_cache: true
- name: remove old ppa repository
apt_repository:
repo: ppa:lutris-team/lutris
state: absent
- name: install lutris libraries
apt:
update_cache: yes
pkg:
- wine
- steam
- name: "Get Lutris version"
uri:
url: https://api.github.com/repos/lutris/lutris/releases/latest
body_format: json
register: git_info
- name: Install deb package
become: yes
apt:
deb: "{{ (git_info.json | json_query('assets[*].browser_download_url') | select('match', '.*deb'))[0] }}"