2020-04-11 14:07:51 +02:00
|
|
|
- name: configure system
|
|
|
|
|
hosts: localhost
|
2018-02-05 20:09:05 +01:00
|
|
|
connection: local
|
|
|
|
|
become: false
|
|
|
|
|
tasks:
|
2018-08-17 19:44:31 +02:00
|
|
|
- name: read machine-specific variables
|
|
|
|
|
include_vars:
|
|
|
|
|
file: _machines/{{ ansible_hostname }}.yml
|
|
|
|
|
name: machine
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
2021-10-31 13:24:43 +01:00
|
|
|
- name: read variables
|
|
|
|
|
include_vars:
|
|
|
|
|
file: variables.yml
|
|
|
|
|
tags:
|
|
|
|
|
- always
|
|
|
|
|
|
2018-02-08 21:45:02 +01:00
|
|
|
- set_fact:
|
|
|
|
|
distro: "{{ ansible_distribution|lower }}"
|
2018-08-17 19:44:31 +02:00
|
|
|
tags:
|
|
|
|
|
- always
|
2018-02-08 21:45:02 +01:00
|
|
|
|
2021-10-06 21:21:09 +02:00
|
|
|
- name: check for valid distro
|
2020-03-02 11:52:45 +01:00
|
|
|
assert:
|
2024-04-10 15:57:38 +02:00
|
|
|
that: distro in ('archlinux')
|
2020-03-02 11:52:45 +01:00
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- block:
|
|
|
|
|
- name: install ansible requirements
|
|
|
|
|
package:
|
|
|
|
|
name: "{{ packages[distro] }}"
|
|
|
|
|
state: present
|
|
|
|
|
become: true
|
|
|
|
|
vars:
|
|
|
|
|
packages:
|
|
|
|
|
archlinux:
|
|
|
|
|
- python-jmespath
|
2020-03-02 11:52:45 +01:00
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- block:
|
|
|
|
|
- name: enable multilib repository
|
|
|
|
|
blockinfile:
|
|
|
|
|
path: /etc/pacman.conf
|
|
|
|
|
block: |
|
|
|
|
|
[multilib]
|
|
|
|
|
Include = /etc/pacman.d/mirrorlist
|
|
|
|
|
marker: "# {mark} ANSIBLE MANAGED multilib"
|
|
|
|
|
become: true
|
2020-03-03 23:33:14 +01:00
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- name: enable parallel download
|
|
|
|
|
blockinfile:
|
|
|
|
|
path: /etc/pacman.conf
|
|
|
|
|
insertafter: '\[options\]'
|
|
|
|
|
block: |
|
|
|
|
|
ParallelDownloads = 5
|
|
|
|
|
marker: "# {mark} ANSIBLE MANAGED parallel_download"
|
|
|
|
|
become: true
|
2022-06-30 20:41:40 +02:00
|
|
|
|
2024-04-10 19:55:21 +02:00
|
|
|
- block:
|
|
|
|
|
- name: upgrade system
|
|
|
|
|
pacman:
|
|
|
|
|
upgrade: true
|
|
|
|
|
update_cache: true
|
|
|
|
|
become: true
|
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
|
|
tags: [system-update]
|
|
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- name: install pacman-contrib for paccache
|
|
|
|
|
package:
|
|
|
|
|
name: pacman-contrib
|
|
|
|
|
state: present
|
|
|
|
|
become: true
|
2021-08-13 18:53:01 +02:00
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- block:
|
|
|
|
|
- name: install pacman cache clean service
|
|
|
|
|
copy:
|
|
|
|
|
dest: /etc/systemd/system/pacman-cache-cleanup.service
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: '0644'
|
|
|
|
|
content: |
|
|
|
|
|
[Service]
|
|
|
|
|
Type=oneshot
|
|
|
|
|
ExecStart=/bin/sh -c '/usr/bin/paccache -rk1 && /usr/bin/paccache -ruk0'
|
|
|
|
|
RemainAfterExit=true
|
2020-12-08 22:00:44 +01:00
|
|
|
become: true
|
|
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- name: install pacman cache clean timer
|
|
|
|
|
copy:
|
|
|
|
|
dest: /etc/systemd/system/pacman-cache-cleanup.timer
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: '0644'
|
|
|
|
|
content: |
|
|
|
|
|
[Timer]
|
|
|
|
|
OnCalendar=daily
|
2020-12-08 22:00:44 +01:00
|
|
|
become: true
|
|
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- name: enable pacman cache clean timer
|
|
|
|
|
systemd:
|
|
|
|
|
name: pacman-cache-cleanup.timer
|
|
|
|
|
enabled: true
|
|
|
|
|
state: started
|
|
|
|
|
daemon_reload: true
|
2020-12-08 22:00:44 +01:00
|
|
|
become: true
|
2024-04-10 15:57:38 +02:00
|
|
|
tags: [pacman_cache_cleanup]
|
2020-12-08 22:00:44 +01:00
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
when: distro == 'archlinux'
|
2020-03-02 11:52:45 +01:00
|
|
|
|
2022-07-02 15:44:02 +02:00
|
|
|
- block:
|
|
|
|
|
- name: create dotfiles group
|
|
|
|
|
group:
|
|
|
|
|
name: dotfiles
|
|
|
|
|
state: present
|
|
|
|
|
become: true
|
|
|
|
|
become_user: root
|
|
|
|
|
|
|
|
|
|
- name: create dotfiles user
|
|
|
|
|
user:
|
|
|
|
|
name: dotfiles
|
|
|
|
|
group: dotfiles
|
|
|
|
|
home: /var/lib/dotfiles
|
|
|
|
|
create_home: false
|
|
|
|
|
shell: /bin/bash
|
|
|
|
|
system: true
|
|
|
|
|
become: true
|
|
|
|
|
become_user: root
|
|
|
|
|
|
|
|
|
|
- name: create dotfiles directory
|
|
|
|
|
file:
|
|
|
|
|
state: directory
|
|
|
|
|
path: /var/lib/dotfiles
|
|
|
|
|
owner: dotfiles
|
|
|
|
|
group: dotfiles
|
|
|
|
|
mode: '0775' # group needs write access!
|
|
|
|
|
become: true
|
|
|
|
|
become_user: root
|
|
|
|
|
|
|
|
|
|
- name: fix permissions for dotfiles directory
|
|
|
|
|
shell: |
|
|
|
|
|
cd /var/lib/dotfiles
|
2022-07-02 15:56:34 +02:00
|
|
|
if [[ -e .git ]] ; then
|
|
|
|
|
# There is no sane way to specify the global .gitconfig to use, so we
|
|
|
|
|
# actually have to override HOME so git looks into ~/.gitconfig
|
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
|
set -o pipefail
|
|
|
|
|
set -o errexit
|
|
|
|
|
git config --global --add safe.directory /var/lib/dotfiles
|
|
|
|
|
git ls-tree -z --name-only HEAD | xargs --null chown --changes --recursive dotfiles:dotfiles
|
|
|
|
|
git ls-tree -z --name-only HEAD | xargs --null chmod --changes --recursive g+wX
|
|
|
|
|
else
|
|
|
|
|
chown --changes --recursive dotfiles:dotfiles .
|
|
|
|
|
chmod --changes --recursive g+wX .
|
|
|
|
|
fi
|
2022-07-02 15:44:02 +02:00
|
|
|
args:
|
|
|
|
|
executable: /bin/bash
|
|
|
|
|
register: dotfiles_permission_change
|
|
|
|
|
become: true
|
|
|
|
|
become_user: root
|
|
|
|
|
changed_when: dotfiles_permission_change.stdout_lines|length > 0
|
|
|
|
|
tags: [dotfiles-directory]
|
|
|
|
|
|
2020-12-09 23:58:24 +01:00
|
|
|
- block:
|
2020-12-11 18:04:14 +01:00
|
|
|
- name: install sudo
|
|
|
|
|
package:
|
2021-10-02 11:04:22 +02:00
|
|
|
state: present
|
2020-12-11 18:04:14 +01:00
|
|
|
name: sudo
|
|
|
|
|
|
2020-12-11 18:18:15 +01:00
|
|
|
- name: install dependencies for paru
|
|
|
|
|
package:
|
2021-10-02 11:04:22 +02:00
|
|
|
state: present
|
2020-12-11 18:18:15 +01:00
|
|
|
name:
|
|
|
|
|
- base-devel
|
|
|
|
|
- git
|
2020-12-11 20:08:14 +01:00
|
|
|
become: true
|
2020-12-11 18:18:15 +01:00
|
|
|
|
2020-12-11 17:53:32 +01:00
|
|
|
- name: create build user on arch
|
|
|
|
|
user:
|
|
|
|
|
name: makepkg
|
|
|
|
|
home: /var/lib/makepkg
|
|
|
|
|
create_home: true
|
|
|
|
|
shell: /bin/bash
|
|
|
|
|
system: true
|
2021-10-06 21:17:54 +02:00
|
|
|
become: true
|
2020-12-11 17:53:32 +01:00
|
|
|
|
2021-10-03 15:44:48 +02:00
|
|
|
- name: create paru user on arch
|
|
|
|
|
user:
|
|
|
|
|
name: paru
|
|
|
|
|
home: /var/lib/paru
|
|
|
|
|
create_home: true
|
|
|
|
|
shell: /bin/bash
|
|
|
|
|
system: true
|
2021-10-06 21:17:54 +02:00
|
|
|
become: true
|
2021-10-03 15:44:48 +02:00
|
|
|
|
|
|
|
|
- name: configure passwordless sudo for paru user
|
|
|
|
|
copy:
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: "0600"
|
|
|
|
|
dest: /etc/sudoers.d/paru
|
|
|
|
|
content: |
|
|
|
|
|
paru ALL=(ALL) NOPASSWD: /usr/bin/pacman
|
|
|
|
|
become: true
|
|
|
|
|
|
2020-12-20 20:37:43 +01:00
|
|
|
- name: check if paru is already installed
|
2020-12-09 23:58:24 +01:00
|
|
|
shell: |
|
|
|
|
|
set -o errexit
|
|
|
|
|
|
2022-06-30 06:38:05 +02:00
|
|
|
if pacman -Qi paru-bin >/dev/null 2>&1; then
|
2020-12-09 23:58:24 +01:00
|
|
|
exit 100
|
|
|
|
|
fi
|
2020-12-20 20:37:43 +01:00
|
|
|
exit 0
|
|
|
|
|
args:
|
|
|
|
|
executable: /bin/bash
|
|
|
|
|
changed_when: false
|
|
|
|
|
check_mode: false
|
|
|
|
|
failed_when: result.rc not in (0, 100)
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
- name: build paru on arch
|
|
|
|
|
shell: |
|
|
|
|
|
set -o errexit
|
2020-12-09 23:58:24 +01:00
|
|
|
|
|
|
|
|
mkdir -p /tmp/paru-build
|
|
|
|
|
cd /tmp/paru-build
|
|
|
|
|
|
2022-06-30 06:38:05 +02:00
|
|
|
curl -L -O https://aur.archlinux.org/cgit/aur.git/snapshot/paru-bin.tar.gz
|
|
|
|
|
tar xvf paru-bin.tar.gz
|
|
|
|
|
cd paru-bin
|
2020-12-09 23:58:24 +01:00
|
|
|
makepkg
|
|
|
|
|
args:
|
|
|
|
|
executable: /bin/bash
|
2020-12-11 17:53:32 +01:00
|
|
|
become: true # do not build as root!
|
|
|
|
|
become_user: makepkg
|
2020-12-20 20:37:43 +01:00
|
|
|
when: result.rc != 100
|
2020-12-09 23:58:24 +01:00
|
|
|
|
|
|
|
|
- name: install paru
|
|
|
|
|
shell: |
|
|
|
|
|
set -o errexit
|
|
|
|
|
|
2022-06-30 06:38:05 +02:00
|
|
|
pacman --noconfirm -U /tmp/paru-build/paru-bin/paru-bin-*.pkg.tar.zst
|
2020-12-09 23:58:24 +01:00
|
|
|
rm -rf /tmp/paru-build
|
|
|
|
|
args:
|
|
|
|
|
executable: /bin/bash
|
|
|
|
|
become: true
|
|
|
|
|
when: result.rc != 100
|
|
|
|
|
|
|
|
|
|
when: distro == 'archlinux'
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 17:31:48 +01:00
|
|
|
- block:
|
|
|
|
|
- name: load package list
|
|
|
|
|
include_vars:
|
|
|
|
|
file: packages.yml
|
|
|
|
|
|
2021-10-02 12:54:11 +02:00
|
|
|
- name: force-update iptables to iptables-nft on arch
|
2022-06-30 06:38:05 +02:00
|
|
|
shell: pacman -Q iptables && yes | pacman -S iptables-nft
|
2021-10-02 12:54:11 +02:00
|
|
|
changed_when: false
|
2021-10-06 21:17:54 +02:00
|
|
|
become: true
|
2021-10-03 11:07:35 +02:00
|
|
|
when: distro == 'archlinux'
|
2018-02-05 20:09:05 +01:00
|
|
|
|
2020-03-03 17:31:48 +01:00
|
|
|
- set_fact:
|
|
|
|
|
defined_packages: "{{ packages|json_query('keys(list)') }}"
|
2018-02-05 20:09:05 +01:00
|
|
|
|
2020-03-03 17:31:48 +01:00
|
|
|
- set_fact:
|
|
|
|
|
distro_packages: "{{ packages|json_query('list.*.%s'|format(distro)) }}"
|
2018-02-05 20:09:05 +01:00
|
|
|
|
2020-03-03 17:31:48 +01:00
|
|
|
- name: check list
|
|
|
|
|
assert:
|
|
|
|
|
that: "defined_packages|length == distro_packages|length"
|
2018-02-05 20:09:05 +01:00
|
|
|
|
2020-10-05 22:03:05 +02:00
|
|
|
- set_fact:
|
|
|
|
|
defined_packages_remove: "{{ packages|json_query('keys(remove)') }}"
|
|
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
distro_packages_remove: "{{ packages|json_query('remove.*.%s'|format(distro)) }}"
|
|
|
|
|
|
|
|
|
|
- name: check list
|
|
|
|
|
assert:
|
|
|
|
|
that: "defined_packages_remove|length == distro_packages_remove|length"
|
|
|
|
|
|
2022-06-30 06:38:05 +02:00
|
|
|
- name: remove packages
|
2020-03-03 17:31:48 +01:00
|
|
|
package:
|
|
|
|
|
name: "{{ packages|json_query(query) }}"
|
2022-06-30 06:38:05 +02:00
|
|
|
state: absent
|
2020-03-03 17:31:48 +01:00
|
|
|
become: true
|
|
|
|
|
vars:
|
2022-06-30 06:38:05 +02:00
|
|
|
query: "{{ 'remove.*.%s[]'|format(distro) }}"
|
2020-10-05 22:03:05 +02:00
|
|
|
|
2022-06-30 06:38:05 +02:00
|
|
|
- name: install packages
|
2020-10-05 22:03:05 +02:00
|
|
|
package:
|
|
|
|
|
name: "{{ packages|json_query(query) }}"
|
2022-06-30 06:38:05 +02:00
|
|
|
state: present
|
2020-10-05 22:03:05 +02:00
|
|
|
become: true
|
|
|
|
|
vars:
|
2022-06-30 06:38:05 +02:00
|
|
|
query: "{{ 'list.*.%s[]'|format(distro) }}"
|
2022-01-04 18:13:14 +01:00
|
|
|
|
2020-12-09 00:15:54 +01:00
|
|
|
- name: install machine-specific packages
|
|
|
|
|
package:
|
|
|
|
|
name: "{{ machine.packages }}"
|
|
|
|
|
state: present
|
|
|
|
|
when: machine.packages is defined
|
|
|
|
|
become: true
|
|
|
|
|
|
2020-03-03 17:31:48 +01:00
|
|
|
tags: [packages]
|
2018-02-05 20:09:05 +01:00
|
|
|
|
2020-12-08 22:00:44 +01:00
|
|
|
- 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
|
2020-12-09 19:36:41 +01:00
|
|
|
become: true
|
2020-12-09 21:43:57 +01:00
|
|
|
|
|
|
|
|
- name: install lz4
|
|
|
|
|
package:
|
|
|
|
|
name: lz4
|
2021-10-02 11:04:22 +02:00
|
|
|
state: present
|
2020-12-09 21:43:57 +01:00
|
|
|
become: true
|
|
|
|
|
|
|
|
|
|
- name: use lz4 for mkinitcpio compression
|
|
|
|
|
lineinfile:
|
|
|
|
|
path: /etc/mkinitcpio.conf
|
|
|
|
|
regexp: '^#?COMPRESSION=.*$'
|
|
|
|
|
line: 'COMPRESSION="lz4"'
|
|
|
|
|
become: true
|
2020-12-09 21:48:20 +01:00
|
|
|
notify:
|
|
|
|
|
- rebuild initrd
|
2020-12-09 19:36:41 +01:00
|
|
|
when: distro == 'archlinux'
|
2020-12-08 22:00:44 +01:00
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
disable_services:
|
|
|
|
|
- sshd
|
|
|
|
|
when: distro == 'archlinux'
|
2019-05-20 21:29:26 +02:00
|
|
|
|
2018-02-09 17:56:43 +01:00
|
|
|
- name: disable services
|
|
|
|
|
service:
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: false
|
|
|
|
|
name: "{{ item }}"
|
2019-05-20 21:29:26 +02:00
|
|
|
with_items: "{{ disable_services }}"
|
2018-02-09 17:56:43 +01:00
|
|
|
become: true
|
2020-12-08 23:41:35 +01:00
|
|
|
when: manage_services|default(true)|bool
|
2020-12-08 22:00:44 +01:00
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
enable_services:
|
|
|
|
|
- NetworkManager
|
|
|
|
|
- docker
|
|
|
|
|
- libvirtd
|
|
|
|
|
- systemd-timesyncd
|
2020-12-11 20:08:25 +01:00
|
|
|
- pcscd
|
2018-02-09 17:56:43 +01:00
|
|
|
|
|
|
|
|
- name: enable services
|
|
|
|
|
service:
|
|
|
|
|
state: started
|
|
|
|
|
enabled: true
|
|
|
|
|
name: "{{ item }}"
|
2020-12-08 22:00:44 +01:00
|
|
|
with_items: "{{ enable_services }}"
|
2020-02-23 14:56:14 +01:00
|
|
|
become: true
|
2020-12-08 23:41:35 +01:00
|
|
|
when: manage_services|default(true)|bool
|
2020-02-23 14:56:14 +01:00
|
|
|
|
2018-02-09 17:56:43 +01:00
|
|
|
- name: get systemd boot target
|
|
|
|
|
command: systemctl get-default
|
|
|
|
|
register: systemd_target
|
|
|
|
|
changed_when: false
|
2020-04-01 10:15:58 +02:00
|
|
|
check_mode: false
|
2018-02-09 17:56:43 +01:00
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
default_target: multi-user.target
|
|
|
|
|
|
|
|
|
|
- name: set systemd boot target
|
|
|
|
|
command: systemctl set-default {{ default_target }}
|
|
|
|
|
when: systemd_target.stdout != default_target
|
|
|
|
|
become: true
|
|
|
|
|
|
|
|
|
|
- name: handle lid switch
|
|
|
|
|
lineinfile:
|
|
|
|
|
path: /etc/systemd/logind.conf
|
|
|
|
|
regexp: '^HandleLidSwitch='
|
|
|
|
|
line: 'HandleLidSwitch=ignore'
|
|
|
|
|
become: true
|
|
|
|
|
|
|
|
|
|
- name: handle power key
|
|
|
|
|
lineinfile:
|
|
|
|
|
path: /etc/systemd/logind.conf
|
|
|
|
|
regexp: '^HandlePowerKey='
|
|
|
|
|
line: 'HandlePowerKey=suspend'
|
|
|
|
|
become: true
|
|
|
|
|
|
2024-04-10 15:57:38 +02:00
|
|
|
- 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
|
2020-12-08 22:00:44 +01:00
|
|
|
|
|
|
|
|
- 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
|
2021-10-02 11:04:22 +02:00
|
|
|
state: present
|
2020-12-08 22:00:44 +01:00
|
|
|
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
|
2020-12-09 15:27:47 +01:00
|
|
|
become: true
|
2020-12-08 22:00:44 +01:00
|
|
|
|
|
|
|
|
when:
|
|
|
|
|
- distro == 'archlinux'
|
|
|
|
|
- machine.gpu is defined and machine.gpu == 'amd'
|
|
|
|
|
|
2021-10-29 15:50:06 +02:00
|
|
|
- block:
|
2021-10-03 15:44:59 +02:00
|
|
|
- block:
|
|
|
|
|
- name: install spotify from AUR via paru
|
|
|
|
|
shell: |
|
2022-05-02 20:42:15 +02:00
|
|
|
curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --import
|
2021-10-03 15:44:59 +02:00
|
|
|
yes 1 | paru --skipreview --aur --batchinstall --noconfirm -S spotify
|
|
|
|
|
become: true
|
|
|
|
|
become_user: paru
|
|
|
|
|
args:
|
|
|
|
|
creates: /usr/bin/spotify
|
2021-10-02 11:07:14 +02:00
|
|
|
|
|
|
|
|
tags: [spotify]
|
|
|
|
|
|
2019-11-14 09:16:55 +01:00
|
|
|
- set_fact:
|
|
|
|
|
users: "{{ machine.users }}"
|
2018-08-17 21:16:54 +02:00
|
|
|
tags:
|
2019-11-14 09:16:55 +01:00
|
|
|
- always
|
2018-08-17 21:16:54 +02:00
|
|
|
|
2019-11-14 09:16:55 +01:00
|
|
|
- include_tasks: user.yml
|
2018-08-17 21:16:54 +02:00
|
|
|
args:
|
2019-11-14 09:16:55 +01:00
|
|
|
apply:
|
|
|
|
|
become: true
|
|
|
|
|
become_user: "{{ user.name }}"
|
|
|
|
|
with_items: "{{ users }}"
|
2021-10-31 13:39:51 +01:00
|
|
|
no_log: True # less spam
|
2019-11-14 09:16:55 +01:00
|
|
|
loop_control:
|
|
|
|
|
loop_var: user
|
2020-03-03 17:31:48 +01:00
|
|
|
tags:
|
|
|
|
|
- always
|
2020-12-09 21:48:20 +01:00
|
|
|
|
|
|
|
|
handlers:
|
|
|
|
|
- name: rebuild initrd
|
|
|
|
|
command: mkinitcpio -P
|
|
|
|
|
become: true
|
2021-10-03 15:25:35 +02:00
|
|
|
register: mkinitcpio_cmd
|
|
|
|
|
failed_when: >
|
|
|
|
|
mkinitcpio_cmd.rc != 0
|
|
|
|
|
and
|
|
|
|
|
not (mkinitcpio_cmd.rc == 1 and "file not found: `fsck.overlay'" in mkinitcpio_cmd.stderr)
|