mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Improved bluetooth's ansible play
This commit is contained in:
@@ -25,7 +25,22 @@
|
||||
- when: ansible_system == 'Linux'
|
||||
tags: linux
|
||||
block:
|
||||
- name: Configure how long to stay in discoverable mode before going back to non-discoverable
|
||||
tags: discoverable_timeout
|
||||
when: discoverable_timeout is defined
|
||||
become: true
|
||||
notify: Restart Bluez
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/bluetooth/main.conf"
|
||||
line: "DiscoverableTimeout = {{ discoverable_timeout|string|lower }}"
|
||||
regexp: '^.*DiscoverableTimeout\s*=\s*.*$'
|
||||
insertafter: '^[General]$'
|
||||
mode: '0644'
|
||||
create: true
|
||||
backup: true
|
||||
- name: Configure faster Bluetooth connection to devices
|
||||
tags: fast_connectable
|
||||
when: fast_connectable is defined
|
||||
become: true
|
||||
notify: Restart Bluez
|
||||
ansible.builtin.lineinfile:
|
||||
@@ -36,7 +51,22 @@
|
||||
mode: '0644'
|
||||
create: true
|
||||
backup: true
|
||||
- name: Enable all Bluetooth devices as soon as they are found
|
||||
- name: Configure the default adapter's name
|
||||
tags: name
|
||||
when: name is defined
|
||||
become: true
|
||||
notify: Restart Bluez
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/bluetooth/main.conf"
|
||||
line: "Name = {{ name|string|lower }}"
|
||||
regexp: '^.*Name\s*=\s*.*$'
|
||||
insertafter: '^[General]$'
|
||||
mode: '0644'
|
||||
create: true
|
||||
backup: true
|
||||
- name: Enable Bluetooth adapters as soon as they are found
|
||||
tags: auto_enable
|
||||
when: auto_enable is defined
|
||||
become: true
|
||||
notify: Restart Bluez
|
||||
ansible.builtin.lineinfile:
|
||||
|
||||
Reference in New Issue
Block a user