commit 4683c1cc863d20ca8f796283e70c0e6e7a831a9d Author: vincent Date: Thu Apr 11 18:52:29 2019 +0200 add role laptop diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..5964b01 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for bluetooth \ No newline at end of file diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..9605021 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,9 @@ +--- +# handlers file for bluetooth + +- name: restart pulse as user + systemd: name=pulseaudio.service scope=user state=restarted + become: yes + become_user: "{{ user.name }}" + environment: + XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}" \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..748c367 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,34 @@ +--- +# tasks file for bluetooth + +- name: Install Bluetooth packages + pacman: + name: + - bluez + - bluez-utils + - pulseaudio-bluetooth + become: yes + notify: + - restart pulse as user + +- name: Auto-switch between HSP/HSF and A2DP + lineinfile: + dest: /etc/pulse/default.pa + regex: "^load-module module-bluetooth-policy" + state: present + line: "load-module module-bluetooth-policy auto_switch=2" + notify: + - restart pulse as user + become: yes + + +- name: Unblock the bluetooth service + service: name="rfkill-block@bluetooth.service" enabled=no state=stopped + become: yes + + +- name: Enable and start the bluetooth service + service: name=bluetooth.service enabled=yes state=started + become: yes + + \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..897b8d8 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for bluetooth \ No newline at end of file