This role deploys a compiled binary of the hms-mqtt-publisher to a host. It conveniently sets it up as a systemd daemon.
- Compile the binary for the wanted architecture using
cargo build
. - Set
hms_mqtt_publisher_bin_path
to where you've put the compiled binary. - Set the config variables for Home Assistant and/or simple MQTT publishing.
- Execute the role.
See defaults/main.yml.
---
- name: Deploy MQTT publisher to Raspberry Pi
hosts: pi
gather_facts: true
become: true
vars:
hms_mqtt_publisher_bin_path: /tmp/hms-mqtt-publish
hms_mqtt_publisher_inverter_host: 192.168.1.2
hms_mqtt_publisher_homeassistant:
host: homeassistant.local
username: "{{ vault_hms_mqtt_publisher_homeassistant_username }}"
password: "{{ vault_hms_mqtt_publisher_homeassistant_password }}"
hms_mqtt_publisher_simple:
host: mqtt.local
collections:
- bellackn.homelab
roles:
- hms_mqtt_publisher
MIT