2024-07-16 23:17:32 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- hosts: 10.66.0.1,
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
2024-08-22 23:05:21 +00:00
|
|
|
### Remove remnants of previous versions of this playbook ###
|
|
|
|
|
|
|
|
- name: "Remove remnants from previous versions of this playbook"
|
|
|
|
ansible.builtin.service:
|
|
|
|
enabled: false
|
|
|
|
masked: true
|
|
|
|
name: "droid-juicer-sdm670.service"
|
|
|
|
ignore_errors: true # do not fail if the unit does not exist
|
|
|
|
register: temp_droid_juicer_unit
|
|
|
|
|
|
|
|
- name: "Remove remnants of previous versions of this playbook"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "/etc/systemd/system/droid-juicer-sdm670.service"
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Reload systemd units
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
when: temp_droid_juicer_unit.changed
|
|
|
|
|
2024-07-16 23:17:32 +00:00
|
|
|
### Various Small Fixes ###
|
|
|
|
|
|
|
|
- name: "Copy /usr/share/initramfs-tools/hooks/qcom-firmware"
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: qcom-firmware
|
|
|
|
dest: /usr/share/initramfs-tools/hooks/qcom-firmware
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u+rwx
|
|
|
|
force: true
|
|
|
|
|
|
|
|
# Has been merged, but package did not have a new release yet
|
|
|
|
# https://salsa.debian.org/DebianOnMobile-team/qcom-phone-utils/-/merge_requests/2
|
|
|
|
|
2024-08-22 23:05:21 +00:00
|
|
|
- name: "Create directory for a unit override for droid-juicer.service"
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "/etc/systemd/system/droid-juicer.service.d/"
|
|
|
|
state: directory
|
|
|
|
mode: '0644'
|
|
|
|
|
|
|
|
- name: "Copy override.conf for droid-juicer.service"
|
2024-07-16 23:17:32 +00:00
|
|
|
ansible.builtin.copy:
|
2024-08-22 23:05:21 +00:00
|
|
|
src: override.conf
|
|
|
|
dest: /etc/systemd/system/droid-juicer.service.d/override.conf
|
2024-07-16 23:17:32 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
2024-08-22 23:05:21 +00:00
|
|
|
mode: u+rw
|
2024-07-16 23:17:32 +00:00
|
|
|
force: true
|
2024-08-22 23:05:21 +00:00
|
|
|
register: droid_juicer_unit_override
|
|
|
|
# Original unit has a hardcoded value, we'll just an override temporarily
|
2024-07-16 23:17:32 +00:00
|
|
|
# https://gitlab.com/mobian1/droid-juicer/-/issues/4
|
|
|
|
|
2024-08-22 23:05:21 +00:00
|
|
|
- name: "Reload systemd units"
|
2024-07-16 23:17:32 +00:00
|
|
|
ansible.builtin.systemd:
|
|
|
|
daemon_reload: yes
|
2024-08-22 23:05:21 +00:00
|
|
|
when: droid_juicer_unit_override.changed
|
2024-07-16 23:17:32 +00:00
|
|
|
|
2024-08-22 23:05:21 +00:00
|
|
|
- name: "Restart droid-juicer.service after adding the override"
|
|
|
|
ansible.builtin.systemd:
|
2024-07-16 23:17:32 +00:00
|
|
|
enabled: true
|
2024-08-22 23:05:21 +00:00
|
|
|
state: restarted
|
|
|
|
name: "droid-juicer.service"
|
|
|
|
when: droid_juicer_unit_override.changed
|
2024-07-16 23:17:32 +00:00
|
|
|
|
|
|
|
### Bluetooth ###
|
|
|
|
|
|
|
|
- name: "Copy /opt/bluetooth-mac.bash"
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: bluetooth-mac.bash
|
|
|
|
dest: /opt/bluetooth-mac.bash
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u+rwx
|
|
|
|
force: true
|
|
|
|
|
|
|
|
- name: "Copy /etc/udev/rules.d/bluetooth.rules"
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: bluetooth-udev.rules
|
|
|
|
dest: /etc/udev/rules.d/bluetooth.rules
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u+rw
|
|
|
|
force: true
|