diff --git a/pis/03-install-pulseaudio-bluetooth.yml b/pis/03-install-pulseaudio-bluetooth.yml index 1e1421e..62c15f5 100644 --- a/pis/03-install-pulseaudio-bluetooth.yml +++ b/pis/03-install-pulseaudio-bluetooth.yml @@ -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 diff --git a/pis/04-squeezelite.yml b/pis/04-squeezelite.yml new file mode 100644 index 0000000..74a4e1a --- /dev/null +++ b/pis/04-squeezelite.yml @@ -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 diff --git a/pis/bt-agent.service b/pis/bt-agent.service index 6bb7c22..980cd32 100644 --- a/pis/bt-agent.service +++ b/pis/bt-agent.service @@ -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] diff --git a/pis/inventory.yml b/pis/inventory.yml new file mode 100644 index 0000000..9a33a7a --- /dev/null +++ b/pis/inventory.yml @@ -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: diff --git a/pis/squeezelite.cfg b/pis/squeezelite.cfg new file mode 100644 index 0000000..3f3e40e --- /dev/null +++ b/pis/squeezelite.cfg @@ -0,0 +1,3 @@ +SL_NAME="{{squeezelite_name}}" +SL_SOUNDCARD="pulse" +SB_SERVER_IP="192.168.178.80"