This commit is contained in:
Martin Bauer 2020-01-16 21:09:14 +01:00
parent d9cd53477f
commit 274f15b213
5 changed files with 33 additions and 8 deletions

View File

@ -3,17 +3,13 @@
# where "raspberrypi" is the hostname of the pi
---
- hosts: all
- hosts: raspberrypi
gather_facts: false
remote_user: root
vars:
bluetooth_mac_address: B8:27:EB:AA:23:4E
vars_prompt:
- name: bluetooth_name
prompt: Name of Bluetooth device
private: no
tasks:
# --- Initial Checks ---
- fail: msg="Make sure to set the MAC address of the BT device to variable 'bluetooth_mac_address_audio'"
when: bluetooth_mac_address_audio is undefined
- name: Detect Raspi Model
slurp:
src: /sys/firmware/devicetree/base/model

10
pis/04-squeezelite.yml Normal file
View File

@ -0,0 +1,10 @@
---
- hosts: raspberrypi
gather_facts: false
remote_user: root
tasks:
- name: Apt install squeezelite package
apt: name=squeezelite cache_valid_time=7200 state=present
- name: Install config file
template: src=squeezelite.cfg dest=/etc/default/squeezelite

View File

@ -11,7 +11,7 @@ Restart=always
RestartSec=1
User=root
# make first adaptor discoverable
ExecStartPre=/bin/start_bt_discoverable {{bluetooth_mac_address}} {{bluetooth_name}}
ExecStartPre=/bin/start_bt_discoverable {{bluetooth_mac_address_audio}} {{bluetooth_name}}
ExecStart=bt-agent -c NoInputNoOutput
[Install]

16
pis/inventory.yml Normal file
View File

@ -0,0 +1,16 @@
all:
hosts:
server:
ansible_host: home.bauer.tech
ansible_port: 22187
children:
iot:
hosts:
raspberrypi:
bluetooth_mac_address_audio: B8:27:EB:AA:23:4E
bluetooth_name: MyTestRaspberry
squeezelite_name: MyTestRaspberry
heatingpi:
bedroompi:
kitchenpi:

3
pis/squeezelite.cfg Normal file
View File

@ -0,0 +1,3 @@
SL_NAME="{{squeezelite_name}}"
SL_SOUNDCARD="pulse"
SB_SERVER_IP="192.168.178.80"