sargo-temp/ansible/audio.yml

68 lines
2.2 KiB
YAML

---
- hosts: all
tasks:
### ALSA Config ###
- name: "Remove previously downloaded version of alsa ucm configs"
ansible.builtin.file:
path: "/root/alsa-ucm-conf-master.tar.gz"
state: absent
- 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"
url: "https://gitlab.com/a-wai/alsa-ucm-conf-sdm670/-/archive/master/alsa-ucm-conf-master.tar.gz"
dest: /root/alsa-ucm-conf-master.tar.gz
force: true # overwrite if the already have a previous version
mode: '0440'
delay: 2
retries: 20
- 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
### Remove Remnants Of Previous Playbook Versions ###
- name: "Deactivate systemd unit if it exists, ignore errors if it does not"
ansible.builtin.systemd_service:
name: q6voiced-temp.service
state: stopped
enabled: false
masked: true
ignore_errors: true
- name: "Remove remnants of previous versions of this playbook"
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- "/opt/tinyalsa"
- "/opt/q6voiced"
- "/etc/systemd/system/q6voiced-temp.service"
- "/etc/systemd/system/q6voiced.service"
- "/etc/q6voiced.conf"
- "/usr/share/wireplumber/wireplumber.conf.d/51-qcom-sdm845.conf"
- name: "Remove remnants of previous verions of this playbook"
ansible.builtin.apt:
pkg:
- libtinyalsa # package will have to be renamed for the repos
- libtinyalsa-dev
- tinyalsa
- q6voiced
- libtinyalsa2
- libtinyalsa2-dev
state: absent