Add support for arch linux

This commit is contained in:
2020-12-08 22:00:44 +01:00
parent 9d7c0d2428
commit 1f0ea0e7be
5 changed files with 273 additions and 20 deletions

View File

@@ -2,6 +2,8 @@ font_size: 10
letter_space: 0 letter_space: 0
terminal_binary: urxvt terminal_binary: urxvt
gpu: amd
users: users:
- name: hannes - name: hannes
vt: 1 vt: 1

View File

@@ -24,6 +24,8 @@ _install() {
sudo dnf install --assumeyes "${_package}" sudo dnf install --assumeyes "${_package}"
elif [[ $NAME == "Ubuntu" ]] ; then elif [[ $NAME == "Ubuntu" ]] ; then
sudo apt-get install --assume-yes "${_package}" sudo apt-get install --assume-yes "${_package}"
elif [[ $NAME == "Arch Linux" ]] ; then
sudo pacman -S --noconfirm "${_package}"
else else
2>&1 printf "Unsupported distro $NAME, exiting" 2>&1 printf "Unsupported distro $NAME, exiting"
exit 1 exit 1

View File

@@ -14,24 +14,32 @@ packages:
ubuntu: ubuntu:
- build-essential - build-essential
- exuberant-ctags - exuberant-ctags
archlinux:
- gcc
golang: golang:
fedora: ["golang", "glibc-static"] fedora: ["golang", "glibc-static"]
ubuntu: ["golang-go"] ubuntu: ["golang-go"]
archlinux: ["go"]
make: make:
fedora: ["make"] fedora: ["make"]
ubuntu: ["make"] ubuntu: ["make"]
archlinux: ["make"]
gdb: gdb:
fedora: ["gdb"] fedora: ["gdb"]
ubuntu: ["gdb"] ubuntu: ["gdb"]
archlinux: ["gdb"]
strace: strace:
fedora: ["strace"] fedora: ["strace"]
ubuntu: ["strace"] ubuntu: ["strace"]
archlinux: ["strace"]
sudo: sudo:
fedora: ["sudo"] fedora: ["sudo"]
ubuntu: ["sudo"] ubuntu: ["sudo"]
archlinux: ["sudo"]
apt: apt:
fedora: [] fedora: []
ubuntu: ["apt-file"] ubuntu: ["apt-file"]
archlinux: []
xorg: xorg:
fedora: fedora:
- '@base-x' - '@base-x'
@@ -39,277 +47,396 @@ packages:
- xorg-x11-drv-libinput - xorg-x11-drv-libinput
- libinput - libinput
ubuntu: [] ubuntu: []
archlinux:
- xorg-server
- xorg-xrandr
- xorg-xkill
- xorg-setxkbmap
- xorg-xev
- xorg-xprop
- xorg-xset
dmenu: dmenu:
fedora: ["dmenu"] fedora: ["dmenu"]
ubuntu: ["dmenu"] ubuntu: ["dmenu"]
archlinux: ["dmenu"]
ansible: ansible:
fedora: ["ansible"] fedora: ["ansible"]
ubuntu: ["ansible"] ubuntu: ["ansible"]
archlinux: ["ansible"]
xdotool: xdotool:
fedora: ["xdotool"] fedora: ["xdotool"]
ubuntu: ["xdotool"] ubuntu: ["xdotool"]
archlinux: ["xdotool"]
arandr: arandr:
fedora: ["arandr"] fedora: ["arandr"]
ubuntu: ["arandr"] ubuntu: ["arandr"]
archlinux: ["arandr"]
borgbackup: borgbackup:
fedora: ["borgbackup"] fedora: ["borgbackup"]
ubuntu: ["borgbackup"] ubuntu: ["borgbackup"]
archlinux: ["borgbackup"]
docker: docker:
fedora: ["docker"] fedora: ["docker"]
ubuntu: ["docker.io"] ubuntu: ["docker.io"]
archlinux: ["docker", "docker-compose"]
font-awesome: font-awesome:
fedora: ["fontawesome-fonts", "fontawesome-fonts-web"] fedora: ["fontawesome-fonts", "fontawesome-fonts-web"]
ubuntu: ["fonts-font-awesome"] ubuntu: ["fonts-font-awesome"]
archlinux: ["ttf-font-awesome"]
font-inconsolata: font-inconsolata:
fedora: ["levien-inconsolata-fonts"] fedora: ["levien-inconsolata-fonts"]
ubuntu: ["fonts-inconsolata"] ubuntu: ["fonts-inconsolata"]
taskwarrior: archlinux: ["ttf-inconsolata"]
fedora: ["task", "tasksh"] font-dejavu:
ubuntu: ["taskwarrior"] fedora: []
ubuntu: []
archlinux: ["ttf-dejavu"]
font-libertine:
fedora: []
ubuntu: []
archlinux: ["ttf-linux-libertine"]
git: git:
fedora: ["git", "gitk"] fedora: ["git", "gitk"]
ubuntu: ["git", "git-extras", "gitk", "git-email"] ubuntu: ["git", "git-extras", "gitk", "git-email"]
archlinux: ["git"]
htop: htop:
fedora: ["htop"] fedora: ["htop"]
ubuntu: ["htop"] ubuntu: ["htop"]
archlinux: ["htop"]
feh: feh:
fedora: ["feh"] fedora: ["feh"]
ubuntu: ["feh"] ubuntu: ["feh"]
archlinux: ["feh"]
i3: i3:
fedora: ["i3"] fedora: ["i3"]
ubuntu: ["i3"] ubuntu: ["i3"]
archlinux: ["i3"]
i3lock: i3lock:
fedora: ["i3lock"] fedora: ["i3lock"]
ubuntu: ["i3lock"] ubuntu: ["i3lock"]
archlinux: ["i3lock"]
pluma: pluma:
fedora: ["pluma"] fedora: ["pluma"]
ubuntu: ["pluma"] ubuntu: ["pluma"]
archlinux: ["pluma"]
vim: vim:
fedora: ["vim-enhanced"] fedora: ["vim-enhanced"]
ubuntu: ["vim"] ubuntu: ["vim"]
archlinux: ["gvim"]
neovim: neovim:
fedora: ["neovim", "python3-neovim"] fedora: ["neovim", "python3-neovim"]
ubuntu: ["neovim"] ubuntu: ["neovim"]
archlinux: ["neovim"]
network-manager-applet: network-manager-applet:
fedora: ["network-manager-applet"] fedora: ["network-manager-applet"]
ubuntu: [] ubuntu: []
archlinux: ["network-manager-applet"]
pasystray: pasystray:
fedora: ["pasystray"] fedora: ["pasystray"]
ubuntu: ["pasystray"] ubuntu: ["pasystray"]
archlinux: ["pasystray"]
redshift: redshift:
fedora: ["redshift-gtk"] fedora: ["redshift-gtk"]
ubuntu: ["redshift-gtk"] ubuntu: ["redshift-gtk"]
archlinux: ["redshift"]
pavucontrol: pavucontrol:
fedora: ["pavucontrol"] fedora: ["pavucontrol"]
ubuntu: ["pavucontrol"] ubuntu: ["pavucontrol"]
archlinux: ["pavucontrol-qt"]
pinentry-qt: pinentry-qt:
fedora: ["pinentry", "pinentry-curses", "pinentry-qt"] fedora: ["pinentry", "pinentry-curses", "pinentry-qt"]
ubuntu: ["pinentry-curses", "pinentry-qt"] ubuntu: ["pinentry-curses", "pinentry-qt"]
archlinux: ["pinentry"]
pinta: pinta:
fedora: ["pinta"] fedora: ["pinta"]
ubuntu: ["pinta"] ubuntu: ["pinta"]
archlinux: ["pinta"]
py3status: py3status:
fedora: ["py3status", "python3-pytz", "python3-tzlocal"] fedora: ["py3status", "python3-pytz", "python3-tzlocal"]
ubuntu: ["py3status", "python3-arrow", "python3-tzlocal"] ubuntu: ["py3status", "python3-arrow", "python3-tzlocal"]
archlinux: ["py3status"]
pass: pass:
fedora: ["pass"] fedora: ["pass"]
ubuntu: ["pass"] ubuntu: ["pass"]
archlinux: ["pass"]
keepassx: keepassx:
fedora: ["keepassx"] fedora: ["keepassx"]
ubuntu: ["keepassx"] ubuntu: ["keepassx"]
archlinux: []
urxvt: urxvt:
fedora: ["rxvt-unicode-256color"] fedora: ["rxvt-unicode-256color"]
ubuntu: ["rxvt-unicode-256color"] ubuntu: ["rxvt-unicode-256color"]
archlinux: ["rxvt-unicode"]
tmux: tmux:
fedora: ["tmux"] fedora: ["tmux"]
ubuntu: ["tmux"] ubuntu: ["tmux"]
archlinux: ["tmux"]
screen: screen:
fedora: ["screen"] fedora: ["screen"]
ubuntu: ["screen"] ubuntu: ["screen"]
archlinux: ["screen"]
zsh: zsh:
fedora: ["zsh", "zsh-syntax-highlighting"] fedora: ["zsh", "zsh-syntax-highlighting"]
ubuntu: ["zsh", "zsh-syntax-highlighting"] ubuntu: ["zsh", "zsh-syntax-highlighting"]
archlinux: ["zsh", "zsh-syntax-highlighting", "zsh-autosuggestions", "zsh-completions"]
zathura: zathura:
fedora: ["zathura-pdf-mupdf"] fedora: ["zathura-pdf-mupdf"]
ubuntu: ["zathura", "zathura-pdf-poppler"] ubuntu: ["zathura", "zathura-pdf-poppler"]
archlinux: ["zathura", "zathura-pdf-mupdf"]
pandoc: pandoc:
fedora: ["pandoc"] fedora: ["pandoc"]
ubuntu: ["pandoc"] ubuntu: ["pandoc"]
archlinux: ["pandoc"]
libvirt: libvirt:
fedora: ["virt-manager", "libvirt-client"] fedora: ["virt-manager", "libvirt-client"]
ubuntu: ["virt-manager", "libvirt-bin"] ubuntu: ["virt-manager", "libvirt-bin"]
archlinux: ["virt-manager", "libvirt"]
firefox: firefox:
fedora: ["firefox"] fedora: ["firefox"]
ubuntu: ["firefox"] ubuntu: ["firefox"]
archlinux: ["firefox"]
ranger: ranger:
fedora: ["ranger"] fedora: ["ranger"]
ubuntu: ["ranger"] ubuntu: ["ranger"]
archlinux: ["ranger"]
thunar: thunar:
fedora: ["thunar"] fedora: ["thunar"]
ubuntu: ["thunar"] ubuntu: ["thunar"]
archlinux: ["thunar"]
unclutter: unclutter:
fedora: ["unclutter"] fedora: ["unclutter"]
ubuntu: ["unclutter"] ubuntu: ["unclutter"]
archlinux: ["unclutter"]
chromium: chromium:
fedora: ["chromium"] fedora: ["chromium"]
ubuntu: ["chromium-browser"] ubuntu: ["chromium-browser"]
archlinux: ["chromium"]
libreoffice: libreoffice:
fedora: ["libreoffice", "libreoffice-langpack-de", "libreoffice-langpack-en"] fedora: ["libreoffice", "libreoffice-langpack-de", "libreoffice-langpack-en"]
ubuntu: ["libreoffice"] ubuntu: ["libreoffice"]
archlinux: ["libreoffice-fresh", "libreoffice-fresh-de"]
oxygen: oxygen:
fedora: ["breeze-cursor-theme", "breeze-icon-theme", "breeze-gtk"] fedora: ["breeze-cursor-theme", "breeze-icon-theme", "breeze-gtk"]
ubuntu: ["breeze-cursor-theme", "breeze-icon-theme", "breeze", "gtk3-engines-breeze"] ubuntu: ["breeze-cursor-theme", "breeze-icon-theme", "breeze", "gtk3-engines-breeze"]
archlinux: ["breeze", "breeze-icons", "breeze-gtk", "breeze-grub"]
xcompmgr: xcompmgr:
fedora: ["xcompmgr"] fedora: ["xcompmgr"]
ubuntu: ["xcompmgr"] ubuntu: ["xcompmgr"]
archlinux: ["xcompmgr"]
python: python:
fedora: ["python", "python3-devel"] fedora: ["python", "python3-devel"]
ubuntu: ["python3", "python3-pip", "python3-venv", "virtualenv", "pylint3"] ubuntu: ["python3", "python3-pip", "python3-venv", "virtualenv", "pylint3"]
archlinux: ["python3"]
xbacklight: xbacklight:
fedora: ["xbacklight"] fedora: ["xbacklight"]
ubuntu: ["xbacklight"] ubuntu: ["xbacklight"]
archlinux: ["xorg-xbacklight"]
wireshark: wireshark:
fedora: ["wireshark"] fedora: ["wireshark"]
ubuntu: ["wireshark", "wireshark-qt"] ubuntu: ["wireshark", "wireshark-qt"]
archlinux: ["wireshark-cli", "wireshark-qt"]
dia: dia:
fedora: ["dia"] fedora: ["dia"]
ubuntu: ["dia"] ubuntu: ["dia"]
archlinux: ["dia"]
shutter: shutter:
fedora: ["shutter"] fedora: ["shutter"]
ubuntu: ["shutter"] ubuntu: ["shutter"]
archlinux: []
nmap: nmap:
fedora: ["nmap"] fedora: ["nmap"]
ubuntu: ["nmap"] ubuntu: ["nmap"]
archlinux: ["nmap"]
openvpn: openvpn:
fedora: ["openvpn"] fedora: ["openvpn"]
ubuntu: ["openvpn"] ubuntu: ["openvpn"]
archlinux: ["openvpn"]
curl: curl:
fedora: ["curl"] fedora: ["curl"]
ubuntu: ["curl"] ubuntu: ["curl"]
archlinux: ["curl"]
wget: wget:
fedora: ["wget"] fedora: ["wget"]
ubuntu: ["wget"] ubuntu: ["wget"]
archlinux: ["wget"]
tree: tree:
fedora: ["tree"] fedora: ["tree"]
ubuntu: ["tree"] ubuntu: ["tree"]
archlinux: ["tree"]
which: which:
fedora: ["which"] fedora: ["which"]
ubuntu: [] ubuntu: []
archlinux: ["which"]
zip: zip:
fedora: ["zip"] fedora: ["zip"]
ubuntu: ["zip", "unzip"] ubuntu: ["zip", "unzip"]
archlinux: ["zip", "unzip"]
traceroute: traceroute:
fedora: ["traceroute"] fedora: ["traceroute"]
ubuntu: ["traceroute"] ubuntu: ["traceroute"]
archlinux: ["traceroute"]
tcpdump: tcpdump:
fedora: ["tcpdump"] fedora: ["tcpdump"]
ubuntu: ["tcpdump"] ubuntu: ["tcpdump"]
archlinux: ["tcpdump"]
tar: tar:
fedora: ["tar"] fedora: ["tar"]
ubuntu: ["tar"] ubuntu: ["tar"]
archlinux: ["tar"]
rsync: rsync:
fedora: ["rsync"] fedora: ["rsync"]
ubuntu: ["rsync"] ubuntu: ["rsync"]
archlinux: ["rsync"]
net-tools: net-tools:
fedora: ["net-tools"] fedora: ["net-tools"]
ubuntu: ["net-tools"] ubuntu: ["net-tools"]
archlinux: ["net-tools"]
ntfs: ntfs:
fedora: ["ntfs-3g", "ntfsprogs"] fedora: ["ntfs-3g", "ntfsprogs"]
ubuntu: ["ntfs-3g"] ubuntu: ["ntfs-3g"]
archlinux: ["ntfs-3g"]
lsof: lsof:
fedora: ["lsof"] fedora: ["lsof"]
ubuntu: ["lsof"] ubuntu: ["lsof"]
archlinux: ["lsof"]
iptables: iptables:
fedora: ["iptables"] fedora: ["iptables"]
ubuntu: ["iptables"] ubuntu: ["iptables"]
archlinux: ["iptables"]
pwgen: pwgen:
fedora: ["pwgen"] fedora: ["pwgen"]
ubuntu: ["pwgen"] ubuntu: ["pwgen"]
archlinux: ["pwgen"]
gpg: gpg:
fedora: ["gnupg2", "paperkey", "yubikey-manager"] fedora: ["gnupg2", "paperkey", "yubikey-manager"]
ubuntu: ["gnupg2"] ubuntu: ["gnupg2"]
archlinux: ["gnupg", "paperkey", "yubikey-manager"]
networkmanager: networkmanager:
fedora: ["NetworkManager", "NetworkManager-wifi"] fedora: ["NetworkManager", "NetworkManager-wifi"]
ubuntu: ["network-manager", "network-manager-openvpn", "network-manager-openconnect"] ubuntu: ["network-manager", "network-manager-openvpn", "network-manager-openconnect"]
archlinux: ["networkmanager"]
pulseaudio: pulseaudio:
fedora: ["pulseaudio", "pulseaudio-utils"] fedora: ["pulseaudio", "pulseaudio-utils"]
ubuntu: ["pulseaudio", "pulseaudio-utils"] ubuntu: ["pulseaudio", "pulseaudio-utils"]
archlinux: ["pulseaudio", "pulseaudio-alsa"]
iw: iw:
fedora: ["iw"] fedora: ["iw"]
ubuntu: ["iw"] ubuntu: ["iw"]
archlinux: ["iw"]
cowsay: cowsay:
fedora: ["cowsay"] fedora: ["cowsay"]
ubuntu: ["cowsay"] ubuntu: ["cowsay"]
archlinux: ["cowsay"]
ruby: ruby:
fedora: ["ruby", "ruby-devel", "rubygem-bundler"] fedora: ["ruby", "ruby-devel", "rubygem-bundler"]
ubuntu: ["ruby", "ruby-dev", "ruby-bundler"] ubuntu: ["ruby", "ruby-dev", "ruby-bundler"]
archlinux: ["ruby"]
lxc: lxc:
fedora: ["lxc"] fedora: ["lxc"]
ubuntu: ["lxc"] ubuntu: ["lxc"]
archlinux: ["lxc"]
acpi: acpi:
fedora: ["acpi"] fedora: ["acpi"]
ubuntu: ["acpid"] ubuntu: ["acpid"]
archlinux: ["acpi", "acpid"]
npm: npm:
fedora: ["npm"] fedora: ["npm"]
ubuntu: ["npm"] ubuntu: ["npm"]
archlinux: ["npm"]
xdg: xdg:
fedora: ["xdg-utils"] fedora: ["xdg-utils"]
ubuntu: ["xdg-utils"] ubuntu: ["xdg-utils"]
archlinux: ["xdg-utils"]
docs: docs:
fedora: ["man-pages"] fedora: ["man-pages"]
ubuntu: ["manpages"] ubuntu: ["manpages"]
archlinux: ["man-pages"]
compton: compton:
fedora: ["compton"] fedora: ["compton"]
ubuntu: ["compton"] ubuntu: ["compton"]
archlinux: []
dunst: dunst:
fedora: ["dunst"] fedora: ["dunst"]
ubuntu: ["dunst"] ubuntu: ["dunst"]
archlinux: ["dunst"]
cloc: cloc:
fedora: ["cloc"] fedora: ["cloc"]
ubuntu: ["cloc"] ubuntu: ["cloc"]
archlinux: ["cloc"]
bluetooth: bluetooth:
fedora: [] fedora: []
ubuntu: ["blueman"] ubuntu: ["blueman"]
archlinux: ["bluez", "bluez-tools", "blueman"]
autorandr: autorandr:
fedora: [] fedora: []
ubuntu: ["autorandr"] ubuntu: ["autorandr"]
archlinux: ["autorandr"]
bwm-ng: bwm-ng:
fedora: [] fedora: []
ubuntu: ["bwm-ng"] ubuntu: ["bwm-ng"]
archlinux: ["bwm-ng"]
virtualbox: virtualbox:
fedora: [] fedora: []
ubuntu: ["virtualbox"] ubuntu: ["virtualbox"]
archlinux: ["virtualbox", "virtualbox-host-modules-arch"]
ssh:
fedora: []
ubuntu: []
archlinux: ["openssh"]
sshfs: sshfs:
fedora: [] fedora: []
ubuntu: ["sshfs"] ubuntu: ["sshfs"]
archlinux: ["sshfs"]
expect: expect:
fedora: [] fedora: []
ubuntu: ["expect"] ubuntu: ["expect"]
archlinux: ["expect"]
inotify: inotify:
fedora: [] fedora: []
ubuntu: ["inotify-tools"] ubuntu: ["inotify-tools"]
archlinux: ["inotify-tools"]
rclone: rclone:
fedora: ["rclone"] fedora: ["rclone"]
ubuntu: ["rclone"] ubuntu: ["rclone"]
archlinux: ["rclone"]
dnf: dnf:
fedora: ["python3-dnf"] fedora: ["python3-dnf"]
ubuntu: [] ubuntu: []
archlinux: []
rust: rust:
fedora: [] fedora: []
ubuntu: ["rustc", "cargo"] ubuntu: ["rustc", "cargo"]
archlinux: ["rust", "rustup", "cargo"]
musescore: musescore:
fedora: [] fedora: []
ubuntu: ["musescore"] ubuntu: ["musescore"]
archlinux: ["musescore"]
sipcalc: sipcalc:
fedora: [] fedora: []
ubuntu: ["sipcalc"] ubuntu: ["sipcalc"]
archlinux: ["sipcalc"]
rofi: rofi:
fedora: [] fedora: []
ubuntu: ["rofi"] ubuntu: ["rofi"]
archlinux: ["rofi"]
anki: anki:
fedora: ["anki"] fedora: ["anki"]
ubuntu: ["anki"] ubuntu: ["anki"]
archlinux: ["anki"]
imv:
fedora: []
ubuntu: []
archlinux: ["imv"]
pacman:
fedora: []
ubuntu: []
archlinux: ["pacman", "pacman-contrib"]
steam:
fedora: []
ubuntu: []
archlinux: ["steam"]
remove: remove:
mousepad: mousepad:
fedora: ["mousepad"] fedora: ["mousepad"]
ubuntu: ["mousepad"] ubuntu: ["mousepad"]
archlinux: ["mousepad"]

View File

@@ -17,7 +17,7 @@
- name: Check for valid distro - name: Check for valid distro
assert: assert:
that: distro in ('fedora', 'ubuntu') that: distro in ('fedora', 'ubuntu', 'archlinux')
- block: - block:
- block: - block:
@@ -62,6 +62,34 @@
update_cache: false update_cache: false
become: true become: true
when: distro == 'fedora' when: distro == 'fedora'
- block:
- name: enable multilib repository
blockinfile:
path: /etc/pacman.conf
block: |
[multilib]
Include = /etc/pacman.d/mirrorlist
become: true
- name: Upgrade system
pacman:
upgrade: true
update_cache: true
become: true
changed_when: false
- name: install pacman-contrib for paccache
package:
name: pacman-contrib
state: installed
become: true
- name: Clean cache
command: paccache -rk2 -ruk0
become: true
when: distro == 'archlinux'
tags: [update_system] tags: [update_system]
- name: install selinux specials on fedora - name: install selinux specials on fedora
@@ -122,6 +150,18 @@
query: "{{ 'remove.*.%s[]'|format(distro) }}" query: "{{ 'remove.*.%s[]'|format(distro) }}"
tags: [packages] tags: [packages]
- block:
- name: configure timesyncd on arch
copy:
owner: root
group: root
mode: "0644"
dest: /etc/systemd/timesyncd.conf
content: |
[Time]
NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
- set_fact: - set_fact:
disable_services: disable_services:
- sshd - sshd
@@ -130,7 +170,12 @@
- set_fact: - set_fact:
disable_services: disable_services:
- ssh - ssh
when: distro != 'fedora' when: distro == 'ubuntu'
- set_fact:
disable_services:
- sshd
when: distro == 'archlinux'
- name: disable services - name: disable services
service: service:
@@ -139,28 +184,41 @@
name: "{{ item }}" name: "{{ item }}"
with_items: "{{ disable_services }}" with_items: "{{ disable_services }}"
become: true become: true
when: manage_services|bool|default(true)
- set_fact:
enable_services:
- NetworkManager
# does not work with fedora 31 due to the switch to cgroups v2:
# https://github.com/docker/cli/issues/2104
# https://bugzilla.redhat.com/show_bug.cgi?id=1746355#c1
# - docker
- libvirtd
when: distro == 'fedora'
- set_fact:
enable_services:
- NetworkManager
- docker
- libvirtd
when: distro == 'ubuntu'
- set_fact:
enable_services:
- NetworkManager
- docker
- libvirtd
- systemd-timesyncd
when: distro == 'archlinux'
- name: enable services - name: enable services
service: service:
state: started state: started
enabled: true enabled: true
name: "{{ item }}" name: "{{ item }}"
with_items: with_items: "{{ enable_services }}"
- NetworkManager
# - docker
- libvirtd
become: true
- name: enable docker on ubuntu
# does not work with fedora 31 due to the switch to cgroups v2:
# https://github.com/docker/cli/issues/2104
# https://bugzilla.redhat.com/show_bug.cgi?id=1746355#c1
service:
state: started
enabled: true
name: docker
when: distro != 'fedora'
become: true become: true
when: manage_services|bool|default(true)
- name: get systemd boot target - name: get systemd boot target
command: systemctl get-default command: systemctl get-default
@@ -190,6 +248,59 @@
line: 'HandlePowerKey=suspend' line: 'HandlePowerKey=suspend'
become: true become: true
- block:
- name: create sudonopw group
group:
name: sudonopw
system: true
- name: configure passwordless sudo
copy:
owner: root
group: root
mode: "0600"
dest: /etc/sudoers.d/sudonopw
content: |
%sudonopw ALL=(ALL) NOPASSWD: ALL
become: true
when: distro == 'archlinux'
- block:
- name: install AMDGPU packages
package:
name:
- mesa
- lib32-mesa
- xf86-video-amdgpu
- vulkan-radeon
- lib32-vulkan-radeon
- libva-mesa-driver
- lib32-libva-mesa-driver
- mesa-vdpau
- lib32-mesa-vdpau
state: installed
become: true
- name: set AMDGPU options
copy:
owner: root
group: root
mode: "0600"
dest: /etc/X11/xorg.conf.d/20-amdgpu.conf
content: |
Section "Device"
Identifier "AMD"
Driver "amdgpu"
Option "VariableRefresh" "true"
Option "TearFree" "true"
EndSection
when:
- distro == 'archlinux'
- machine.gpu is defined and machine.gpu == 'amd'
- name: create dotfiles group - name: create dotfiles group
group: group:
name: dotfiles name: dotfiles

View File

@@ -37,6 +37,17 @@
when: distro == 'fedora' when: distro == 'fedora'
tags: [always] tags: [always]
- set_fact:
user_groups:
- libvirt
- wheel
- vboxusers
- wireshark
- docker
- sudonopw
when: distro == 'archlinux'
tags: [always]
- set_fact: - set_fact:
user_group_name: "{{ user.group|default(user.name) }}" user_group_name: "{{ user.group|default(user.name) }}"
tags: [always] tags: [always]