---
- name: install udiskie for automount
  pacman:
    name: udiskie

- name: install media codecs
  pacman:
    name:
      - flac
      - lame
      - opus
      - gstreamer
      - gst-libav
      - gstreamer-vaapi
      - gst-plugins-good
      - gst-plugins-ugly
      - gst-plugins-bad

- name: install pulseaudio
  pacman:
    name:
      - alsa-utils
      - pulseaudio
      - pulseaudio-alsa
      - pulseaudio-jack
      - pavucontrol
      - pamixer
      - paprefs
      - playerctl

- name: configure to switch audio output to newly connected devices
  lineinfile:
    dest: /etc/pulse/default.pa
    state: present
    line: "load-module module-switch-on-connect"

---
- name: install udiskie for automount
  pacman:
    name: udiskie

- name: install media codecs
  pacman:
    name:
      - flac
      - lame
      - opus
      - gstreamer
      - gst-libav
      - gstreamer-vaapi
      - gst-plugins-good
      - gst-plugins-ugly
      - gst-plugins-bad

- name: install pulseaudio
  pacman:
    name:
      - alsa-utils
      - pulseaudio
      - pulseaudio-alsa
      - pulseaudio-jack
      - pavucontrol
      - pamixer
      - paprefs
      - playerctl

- name: install pro-audio packages
  pacman:
    name:
      - pro-audio
      - jack2

- name: add user to realtime group
  user:
    name: '{{ user.name }}'
    groups: realtime
    append: yes

- name: configure to switch audio output to newly connected devices
  lineinfile:
    dest: /etc/pulse/default.pa
    state: present
    line: "load-module module-switch-on-connect"

Install and configure pro-audio packages
Install and configure pro-audio packages
