--- - hosts: 10.66.0.1 tasks: ### ALSA Config ### - name: "Download https://gitlab.com/sdm670-mainline/alsa-ucm-conf/-/archive/master/alsa-ucm-conf-master.tar.gz" ansible.builtin.get_url: url: "https://gitlab.com/sdm670-mainline/alsa-ucm-conf/-/archive/master/alsa-ucm-conf-master.tar.gz" dest: /root/alsa-ucm-conf-master.tar.gz mode: '0440' - name: "Remove alsa ucm configs" ansible.builtin.file: path: "/usr/share/alsa/{{ item }}" state: absent loop: - ucm - ucm2 - name: "Unpack alsa-ucm-conf-master.tar.gz to /usr/share/alsa" ansible.builtin.shell: | tar xvzf /root/alsa-ucm-conf-master.tar.gz -C /usr/share/alsa --strip-components=1 --wildcards "*/ucm" "*/ucm2" args: chdir: /usr/share/alsa ### Call Audio ### - name: "Install gcc, git, libdbus-1-dev, libdbus-cpp-dev and make" ansible.builtin.apt: pkg: - gcc - git - libdbus-1-dev - libdbus-cpp-dev - make state: present update_cache: true - name: "Clone tinyalsa repo" ansible.builtin.git: repo: 'https://github.com/tinyalsa/tinyalsa.git' dest: /opt/tinyalsa version: master - name: "Compile tinyalsa" community.general.make: chdir: /opt/tinyalsa - name: "Install tinyalsa" community.general.make: chdir: /opt/tinyalsa target: install - name: "Run ldconfig" ansible.builtin.command: /sbin/ldconfig args: chdir: /opt/tinyalsa - name: "Clone q6voiced repo" ansible.builtin.git: repo: 'https://gitlab.com/postmarketOS/q6voiced' dest: /opt/q6voiced version: master - name: "Compile q6voiced" ansible.builtin.shell: cmd: "gcc $(pkg-config --cflags dbus-1) q6voiced.c -o q6voiced -ltinyalsa -ldbus-1 -ldl" args: chdir: /opt/q6voiced creates: /opt/q6voiced/q6voiced - name: "Create /etc/q6voiced.conf" ansible.builtin.copy: src: q6voiced.conf dest: /etc/q6voiced.conf owner: root group: root mode: u+rwx force: false - name: "Create q6voiced-temp.service" ansible.builtin.copy: src: q6voiced-temp.service dest: /etc/systemd/system/q6voiced-temp.service owner: root group: root mode: u+rwx force: true register: unit - name: Reload systemd units ansible.builtin.systemd: daemon_reload: yes when: unit.changed - name: "Enable custom service unit for q6voiced" ansible.builtin.service: enabled: true name: "q6voiced-temp.service"