add role laptop
This commit is contained in:
commit
4683c1cc86
2
defaults/main.yml
Normal file
2
defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for bluetooth
|
9
handlers/main.yml
Normal file
9
handlers/main.yml
Normal 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
34
tasks/main.yml
Normal 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
2
vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for bluetooth
|
Loading…
Reference in New Issue
Block a user