diff --git a/roles/raspberry_pi/tasks/20_zigbee2mqtt.yaml b/roles/raspberry_pi/tasks/20_zigbee2mqtt.yaml new file mode 100644 index 0000000..a2ea081 --- /dev/null +++ b/roles/raspberry_pi/tasks/20_zigbee2mqtt.yaml @@ -0,0 +1,33 @@ +--- +- name: Deploy Mosquitto config + ansible.builtin.template: + src: zigbee2mqtt/mosquitto.conf.j2 + dest: "{{ raspberry_pi_mosquitto_config_dir }}/mosquitto.conf" + mode: "0644" + become: true + when: inventory_hostname == 'naruto' + +- name: Deploy Zigbee2MQTT config + ansible.builtin.template: + src: zigbee2mqtt/z2m-configuration.yaml.j2 + dest: "{{ raspberry_pi_z2m_config_dir }}/configuration.yaml" + mode: "0644" + become: true + notify: restart zigbee2mqtt + when: inventory_hostname == 'naruto' + +- name: Deploy docker-compose + ansible.builtin.template: + src: zigbee2mqtt/docker-compose.yml.j2 + dest: "{{ raspberry_pi_compose_dir }}/docker-compose.yml" + mode: "0644" + become: true + when: inventory_hostname == 'naruto' + +- name: Start Zigbee2MQTT stack + ansible.builtin.command: + cmd: docker compose up -d + chdir: "{{ raspberry_pi_compose_dir }}" + become: true + changed_when: false + when: inventory_hostname == 'naruto'