/
/
/
This repo is destined for my server automations and setup.
1---
2# ============================================================================
3# ArtFrame Deployment Playbook
4# ============================================================================
5#
6# The photo frame on the dining room TV.
7#
8# Unlike every other playbook here, the target is not an SSH host: it is an
9# Android TV reached over adb. The play therefore runs on the control machine
10# and drives adb outwards, which is why hosts is localhost and the TV's address
11# lives in artframe_* variables rather than in the inventory's ansible_host.
12#
13# The APK is built from the ArtFrame repo, not here:
14# cd ~/AndroidStudioProjects/ArtFrame && ./gradlew :app:assembleDebug
15#
16# Usage:
17# ansible-playbook artframe.yml
18# ansible-playbook artframe.yml -e artframe_apk=~/AndroidStudioProjects/ArtFrame/app/build/outputs/apk/debug/app-debug.apk
19# ansible-playbook artframe.yml -e artframe_adb_port=40105
20#
21# Wireless debugging does not survive a power cycle on this TV and cannot be
22# re-enabled remotely. After one, re-enable it on the TV and pass the new port.
23#
24# ============================================================================
25
26- name: "ArtFrame - Photo Frame Deployment"
27 hosts: localhost
28 connection: local
29 gather_facts: false
30
31 # host_vars/dining-room-tv.yml holds the device's own settings; load them
32 # explicitly, since the play does not target that host.
33 vars_files:
34 - host_vars/dining-room-tv.yml
35
36 pre_tasks:
37 - name: Display deployment information
38 ansible.builtin.debug:
39 msg: |
40 ============================================================================
41 ArtFrame Deployment
42 ============================================================================
43 Target TV: {{ artframe_host | default('dining-room-tv.home') }}
44 adb mDNS: {{ artframe_adb_mdns_name | default('(not set)', true) }}
45 adb port: {{ artframe_adb_port | default('(not set)', true) }}
46 APK: {{ artframe_apk | default('(config only, no install)', true) }}
47 Albums: {{ artframe_albums | default([]) | length }}
48 MQTT: {{ 'enabled' if artframe_mqtt_enabled | default(false) | bool else 'disabled' }}
49 ============================================================================
50 tags: always
51
52 - name: Warn when no albums are configured
53 ansible.builtin.debug:
54 msg: >-
55 No albums configured. The frame will fall back to its bundled test
56 images. Set artframe_albums in host_vars/dining-room-tv.yml, with the
57 share keys coming from vault.
58 when: (artframe_albums | default([]) | length) == 0
59 tags: always
60
61 roles:
62 - role: adb-artframe
63 tags: [artframe, frame, tv]
64