WIP Arch support

This commit is contained in:
Przemek Grondek 2023-08-26 23:57:26 +02:00
parent b077697687
commit f2e2059cca
43 changed files with 411 additions and 203 deletions

View File

@ -1,24 +1,25 @@
--- ---
- hosts: localhost - hosts: localhost
roles: roles:
- prepare
- ubuntu - ubuntu
- dwm - ubuntu-java
- firefox
- docker
- dotfiles
- java
- jetbrains
- signal - signal
- virtual - dotfiles
- lutris - jetbrains
- ego
- laptop
- prusa-slicer - prusa-slicer
- intellij - intellij
- chromium
- terraform
- no-snap
- flutter
- autofs - autofs
- dwm
- docker
- laptop
- desktop
# - flutter
# - virtual
# - lutris
# - ego
# - terraform
vars: vars:
desktop_src_dir: "{{ ansible_user_dir }}/src/desktop" desktop_src_dir: "{{ ansible_user_dir }}/src/desktop"
arch_src_dir: "{{ ansible_user_dir }}/src/arch"

View File

@ -0,0 +1,31 @@
- name: install client packages
become: yes
community.general.pacman:
name:
- samba
- nfs-utils
- name: install autofs
shell:
cmd:
yay -S --needed --noconfirm autofs
when: ansible_distribution == "Archlinux"
- name: copy bender.autofs
become: yes
copy:
src: etc/auto.master.d/bender.autofs
dest: /etc/autofs/auto.master.d/bender.autofs
- name: copy auto.bender
become: yes
copy:
src: etc/autofs/auto.bender
dest: /etc/autofs/auto.bender
- name: "Enable service"
become: yes
ansible.builtin.systemd:
name: autofs
state: started
enabled: yes

View File

@ -1,8 +0,0 @@
- name: install necessary software
become: yes
apt:
update_cache: yes
pkg:
- autofs
- cifs-utils
- nfs-common

View File

@ -1,3 +1,5 @@
- import_tasks: install.yml - import_tasks: ubuntu.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: configure.yml - import_tasks: arch.yml
when: ansible_distribution == "Archlinux"

View File

@ -1,3 +1,12 @@
- name: install necessary software
become: yes
apt:
update_cache: yes
pkg:
- autofs
- cifs-utils
- nfs-common
- name: copy bender.autofs - name: copy bender.autofs
become: yes become: yes
copy: copy:

View File

@ -1,2 +0,0 @@
- import_tasks: install.yml
when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "22.04"

View File

@ -0,0 +1,67 @@
---
- name: install basic system
become: yes
community.general.pacman:
name:
- dhcpdcd
- efibootmgr
- grub
- lightdm
- lightdm-gtk-greeter
- pipewire
- pipewire-alsa
- pipewire-audio
- helvum
- name: "Enable service"
become: yes
ansible.builtin.systemd:
name: lightdm
state: started
enabled: yes
- name: install terminal packages [Arch]
become: yes
community.general.pacman:
name:
- bind
- graphviz
- htop
- net-tools
- neofetch
- screen
- tmux
- traceroute
- vim
- name: install terminal packages [AUR]
shell:
cmd:
yay -S --needed --noconfirm \
epson-inkjet-printer-escpr
pm-utils
- name: install gui packages
become: yes
community.general.pacman:
name:
- flameshot
- gnome-backgrounds
- gsimplecal
- numlockx
- pavucontrol
- pasystray
- picom
- redshift
- name: install flatpak
become: yes
community.general.pacman:
name:
- flatpak
- name: install the smile emoji picker
community.general.flatpak:
state: present
name: it.mijorus.smile

View File

@ -0,0 +1,6 @@
---
- import_tasks: ubuntu.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: arch.yml
when: ansible_distribution == "Archlinux"

View File

@ -12,7 +12,6 @@
apt: apt:
pkg: pkg:
- vim-gtk3 - vim-gtk3
- git
- htop - htop
- tmux - tmux
- graphviz - graphviz
@ -42,18 +41,13 @@
- pavucontrol - pavucontrol
- pasystray - pasystray
- flameshot - flameshot
- gsimplecal
- name: install the smile emoji picker - name: install the smile emoji picker
community.general.flatpak: community.general.flatpak:
state: present state: present
name: it.mijorus.smile name: it.mijorus.smile
- name: install git
become: yes
apt:
pkg:
- git
- name: install gui apps - name: install gui apps
become: yes become: yes
apt: apt:

View File

@ -0,0 +1,7 @@
- name: install docker
become: yes
community.general.pacman:
update_cache: yes
name:
- docker
- docker-compose

View File

@ -1,4 +1,7 @@
--- ---
- import_tasks: install-docker-io.yml - import_tasks: install-ubuntu.yml
when: ansible_distribution == "Ubuntu" and ansible_distribution_version != "18.04" when: ansible_distribution == "Ubuntu"
- import_tasks: install-arch.yml
when: ansible_distribution == "Archlinux"

View File

@ -1,12 +1,4 @@
--- ---
- name: install required packages
become: yes
apt:
update_cache: yes
pkg:
- git
- make
- name: checkout dotfiles - name: checkout dotfiles
git: git:
repo: "{{ dotfiles.repo }}" repo: "{{ dotfiles.repo }}"

View File

@ -4,8 +4,6 @@
apt: apt:
update_cache: yes update_cache: yes
pkg: pkg:
- git
- make
- build-essential - build-essential
- gcc - gcc
- libx11-dev - libx11-dev
@ -14,6 +12,20 @@
- libxcb-res0-dev - libxcb-res0-dev
- libx11-xcb-dev - libx11-xcb-dev
- libyajl-dev - libyajl-dev
when: ansible_distribution == "Ubuntu"
- name: install required packages for dwm
become: yes
community.general.pacman:
name:
- gcc
- base-devel
- libx11
- libxft
- libxinerama
- libxcb
- yajl
when: ansible_distribution == "Archlinux"
- name: checkout dwm - name: checkout dwm
git: git:
@ -70,12 +82,3 @@
make: make:
chdir: "{{ desktop_src_dir }}/dwm" chdir: "{{ desktop_src_dir }}/dwm"
target: install target: install
- name: debug
debug: msg="{{ make.stdout }}"
- name: install additional packages
become: yes
apt:
pkg:
- gsimplecal

View File

@ -1,29 +0,0 @@
---
- name: install required packages for dwmstatus
become: yes
apt:
update_cache: yes
pkg:
- git
- make
- name: checkout dwmstatus
git:
repo: "{{ dwmstatus.repo }}"
dest: "{{ desktop_src_dir }}/dwmstatus"
clone: yes
update: yes
- name: build dwmstatus
make:
chdir: "{{ desktop_src_dir }}/dwmstatus"
- name: install dwmstatus
become: yes
register: make
make:
chdir: "{{ desktop_src_dir }}/dwmstatus"
target: install
- name: debug
debug: msg="{{ make.stdout }}"

View File

@ -4,8 +4,6 @@
apt: apt:
update_cache: yes update_cache: yes
pkg: pkg:
- git
- make
- cmake - cmake
- libcairo2-dev - libcairo2-dev
- libcurl4-openssl-dev - libcurl4-openssl-dev
@ -21,6 +19,25 @@
- python3-sphinx - python3-sphinx
- libjsoncpp-dev - libjsoncpp-dev
- libuv1-dev - libuv1-dev
when: ansible_distribution == "Ubuntu"
- name: "polybar: install required packages"
become: yes
community.general.pacman:
name:
- cmake
- cairo
- dbus-python
- libcurl-compat
- libxcb
- xcb-proto
- xcb-util-cursor
- xcb-util-image
- xcb-util-wm
- python-sphinx
- jsoncpp
- libuv
when: ansible_distribution == "Archlinux"
- name: "polybar: create src dir" - name: "polybar: create src dir"
file: file:

View File

@ -10,6 +10,19 @@
- dunst - dunst
- arandr - arandr
- fonts-font-awesome - fonts-font-awesome
when: ansible_distribution == "Ubuntu"
- name: install necessary software
become: yes
community.general.pacman:
name:
- i3lock
- dmenu
- feh
- dunst
- arandr
- ttf-font-awesome
when: ansible_distribution == "Archlinux"
- name: override dmenu_run - name: override dmenu_run
become: yes become: yes

View File

@ -1,14 +1,27 @@
--- ---
- name: install required packages for st - name: install required packages for st [Ubuntu]
become: yes become: yes
apt: apt:
update_cache: yes update_cache: yes
pkg: pkg:
- git
- make
- fonts-firacode - fonts-firacode
- fonts-symbola - fonts-symbola
- libharfbuzz-dev - libharfbuzz-dev
when: ansible_distribution == "Ubuntu"
- name: install required packages for st [Arch]
become: yes
community.general.pacman:
name:
- ttf-fira-code
- harfbuzz
when: ansible_distribution == "Archlinux"
- name: install required packages for st [AUR]
shell:
cmd:
yay -S --needed --noconfirm fonts-symbola
when: ansible_distribution == "Archlinux"
- name: checkout st - name: checkout st
git: git:

View File

@ -4,7 +4,6 @@
apt: apt:
update_cache: yes update_cache: yes
pkg: pkg:
- git
- rust-all - rust-all
- cargo - cargo
- libacl1-dev - libacl1-dev

View File

@ -1,9 +1,3 @@
- name: install jmespath for json_query
become: yes
apt:
pkg:
- python3-jmespath
- name: Check if android-sdk has been installed - name: Check if android-sdk has been installed
stat: stat:
path: "{{ android.dir }}" path: "{{ android.dir }}"

View File

@ -1,10 +1,3 @@
- name: install jmespath for json_query
become: yes
apt:
update_cache: yes
pkg:
- python3-jmespath
- name: "Get IntelliJ version" - name: "Get IntelliJ version"
uri: uri:
url: https://data.services.jetbrains.com/products/releases?code=IIU url: https://data.services.jetbrains.com/products/releases?code=IIU

View File

@ -1,6 +0,0 @@
---
- import_tasks: openjdk-8.yml
- import_tasks: openjdk-11.yml
- import_tasks: openjdk-17.yml

View File

@ -0,0 +1,40 @@
- name: install required packages for asusctl
become: yes
apt:
update_cache: yes
pkg:
- cmake
- libayatana-appindicator3-1
- libclang-dev
- libgtk-3-dev
- libglib2.0-dev
- libgdk-pixbuf-2.0-dev
- libpango1.0-dev
- libudev-dev
- make
- rust-all
when: ansible_distribution == "Ubuntu"
- name: checkout asusctl repo
git:
repo: "{{ asusctl.repo }}"
dest: "{{ desktop_src_dir }}/asusctl"
clone: yes
update: yes
- name: build asusctl
make:
chdir: "{{ desktop_src_dir }}/asusctl"
- name: install asusctl
become: yes
make:
chdir: "{{ desktop_src_dir }}/asusctl"
target: install
- name: "Enable service"
become: yes
ansible.builtin.systemd:
name: asusd
state: started
enabled: yes

View File

@ -1,39 +1,9 @@
- name: install required packages for asusctl - import_tasks: asusctl-build.yml
become: yes when: ansible_distribution == "Ubuntu"
apt:
update_cache: yes
pkg:
- cmake
- libayatana-appindicator3-1
- libclang-dev
- libgtk-3-dev
- libglib2.0-dev
- libgdk-pixbuf-2.0-dev
- libpango1.0-dev
- libudev-dev
- make
- rust-all
- name: checkout asusctl repo
git:
repo: "{{ asusctl.repo }}"
dest: "{{ desktop_src_dir }}/asusctl"
clone: yes
update: yes
- name: build asusctl
make:
chdir: "{{ desktop_src_dir }}/asusctl"
- name: install asusctl - name: install asusctl
become: yes shell:
make: cmd:
chdir: "{{ desktop_src_dir }}/asusctl" yay -S --needed --noconfirm asusctl
target: install when: ansible_distribution == "Archlinux"
- name: "Enable service"
become: yes
ansible.builtin.systemd:
name: asusd
state: started
enabled: yes

View File

@ -1,10 +1,18 @@
- name: install required packages for script - name: install required packages for script [Ubuntu]
become: yes become: yes
apt: apt:
update_cache: yes update_cache: yes
pkg: pkg:
- linux-tools-common - linux-tools-common
- linux-tools-generic - linux-tools-generic
when: ansible_distribution == "Ubuntu"
- name: install required packages for script [Arch]
become: yes
community.general.pacman:
name:
- cpupower
when: ansible_distribution == "Archlinux"
- name: copy scripts - name: copy scripts
become: yes become: yes

View File

@ -0,0 +1,24 @@
- name: install required packages for supergfxctl
become: yes
apt:
update_cache: yes
pkg:
- curl
when: ansible_distribution == "Ubuntu"
- name: checkout supergfxctl repo
git:
repo: "{{ supergfxctl.repo }}"
dest: "{{ desktop_src_dir }}/supergfxctl"
clone: yes
update: yes
- name: build supergfxctl
make:
chdir: "{{ desktop_src_dir }}/supergfxctl"
- name: install supergfxctl
become: yes
make:
chdir: "{{ desktop_src_dir }}/supergfxctl"
target: install

View File

@ -1,26 +1,9 @@
- name: install required packages for supergfxctl - import_tasks: supergfxctl-build.yml
become: yes when: ansible_distribution == "Ubuntu"
apt:
update_cache: yes
pkg:
- curl
- git
- build-essential
- make
- name: checkout supergfxctl repo
git:
repo: "{{ supergfxctl.repo }}"
dest: "{{ desktop_src_dir }}/supergfxctl"
clone: yes
update: yes
- name: build supergfxctl
make:
chdir: "{{ desktop_src_dir }}/supergfxctl"
- name: install supergfxctl - name: install supergfxctl
become: yes shell:
make: cmd:
chdir: "{{ desktop_src_dir }}/supergfxctl" yay -S --needed --noconfirm supergfxctl
target: install when: ansible_distribution == "Archlinux"

View File

@ -0,0 +1,41 @@
- name: install jmespath for json_query
become: yes
community.general.pacman:
name: python-jmespath
- name: install packages for building
become: yes
community.general.pacman:
name:
- make
- name: install packages for building
become: yes
community.general.pacman:
extra_args: --needed
name:
- git
- base-devel
- fakeroot
- name: create arch source dir
file:
path: "{{ arch_src_dir }}"
state: directory
- name: checkout yay
git:
repo: https://aur.archlinux.org/yay.git
dest: "{{ arch_src_dir }}/yay"
clone: yes
update: yes
- name: install yay
command:
chdir: "{{ arch_src_dir }}/yay"
cmd:
makepkg -si
- name: update yay cache
shell:
cmd: yay -Y --gendb

View File

@ -0,0 +1,6 @@
---
- import_tasks: ubuntu.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: arch.yml
when: ansible_distribution == "Archlinux"

View File

@ -0,0 +1,15 @@
- name: install jmespath for json_query
become: yes
apt:
update_cache: yes
pkg:
- python3-jmespath
- name: install packages for builds
become: yes
apt:
update_cache: yes
pkg:
- git
- make
- build-essential

View File

@ -1,10 +1,3 @@
- name: install jmespath for json_query
become: yes
apt:
update_cache: yes
pkg:
- python3-jmespath
- name: "Get PrusaSlicer version" - name: "Get PrusaSlicer version"
uri: uri:
url: https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest url: https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest

View File

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

View File

@ -1,19 +1,6 @@
--- ---
- become: yes - import_tasks: ubuntu.yml
block: when: ansible_distribution == "Ubuntu"
- name: add signal gpg key
apt_key:
url: https://updates.signal.org/desktop/apt/keys.asc
state: present
- name: add signal repo - import_tasks: arch.yml
apt_repository: when: ansible_distribution == "Archlinux"
repo: deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
state: present
filename: signal-xenial
- name: install signal-desktop
apt:
update_cache: yes
pkg:
- signal-desktop

View File

@ -0,0 +1,19 @@
---
- become: yes
block:
- name: add signal gpg key
apt_key:
url: https://updates.signal.org/desktop/apt/keys.asc
state: present
- name: add signal repo
apt_repository:
repo: deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
state: present
filename: signal-xenial
- name: install signal-desktop
apt:
update_cache: yes
pkg:
- signal-desktop

View File

@ -0,0 +1,9 @@
---
- import_tasks: openjdk-8.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: openjdk-11.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: openjdk-17.yml
when: ansible_distribution == "Ubuntu"

View File

@ -1,12 +1,21 @@
--- ---
- import_tasks: rearrange-folders.yml - import_tasks: rearrange-folders.yml
when: ansible_distribution == "Ubuntu"
#- import_tasks: cleanup.yml - import_tasks: cleanup.yml
# when: ansible_distribution == "Ubuntu"
#- import_tasks: timezone.yml
# - import_tasks: timezone.yml
#- import_tasks: packages.yml when: ansible_distribution == "Ubuntu"
#
#- import_tasks: set-type.yml - import_tasks: set-type.yml
# when: ansible_distribution == "Ubuntu"
#- import_tasks: dconf.yml
- import_tasks: unsnap.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: firefox.yml
when: ansible_distribution == "Ubuntu"
- import_tasks: dconf.yml
when: ansible_distribution == "Ubuntu"