feat(raspberry_pi): add zigbee2mqtt deploy task
This commit is contained in:
33
roles/raspberry_pi/tasks/20_zigbee2mqtt.yaml
Normal file
33
roles/raspberry_pi/tasks/20_zigbee2mqtt.yaml
Normal file
@@ -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'
|
||||||
Reference in New Issue
Block a user