add role laptop

This commit is contained in:
vincent 2019-04-11 18:52:29 +02:00
commit 4683c1cc86
4 changed files with 47 additions and 0 deletions

2
defaults/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
# defaults file for bluetooth

9
handlers/main.yml Normal file
View File

@ -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 }}"

34
tasks/main.yml Normal file
View File

@ -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

2
vars/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
# vars file for bluetooth