diff --git a/roles/bluetooth/tasks/rpi_install.yml b/roles/bluetooth/tasks/rpi_install.yml index 1aad8b06a..3cf82c49b 100644 --- a/roles/bluetooth/tasks/rpi_install.yml +++ b/roles/bluetooth/tasks/rpi_install.yml @@ -33,13 +33,21 @@ with_items: - { src: 'iiab-bt-pan-on.j2', dest: '/usr/bin/iiab-bt-pan-on' } - { src: 'iiab-bt-pan-off.j2', dest: '/usr/bin/iiab-bt-pan-off' } + - { src: 'iiab-bt-pan-discoverable-on.j2', dest: 'iiab-bt-pan-discoverable-on' } - { src: 'iiab-bt-term-on.j2', dest: '/usr/bin/iiab-bt-term-on' } - { src: 'iiab-bt-term-off.j2', dest: '/usr/bin/iiab-bt-term-off' } # Bluetooth service needs /usr/lib/bluetooth/bluetoothd -C --noplugin=sap +# Copy and patch it + +- name: Copy the bluetooth service + template: + dest: /etc/systemd/system/bluetooth.service + src: /lib/systemd/system/bluetooth.service + - name: Add -C --noplugin=sap to execStart of bluetooth service lineinfile: - path: /lib/systemd/system/bluetooth.service + path: /etc/systemd/system/bluetooth.service regexp: '^ExecStart=/usr/lib/bluetooth/bluetoothd' line: 'ExecStart=/usr/lib/bluetooth/bluetoothd -C --noplugin=sap' diff --git a/roles/bluetooth/templates/bt-pan.service.j2 b/roles/bluetooth/templates/bt-pan.service.j2 index 8512bec1b..eb913841d 100644 --- a/roles/bluetooth/templates/bt-pan.service.j2 +++ b/roles/bluetooth/templates/bt-pan.service.j2 @@ -7,7 +7,7 @@ Requires=network-pre.target [Service] ExecStart=/usr/bin/bt-network -s nap br0 -ExecStartPost=/usr/local/bin/iiab-bt-pan-discoverable-on +ExecStartPost=/usr/bin/iiab-bt-pan-discoverable-on Type=simple [Install]