--- - name: Install dependencies ansible.builtin.apt: name: - libjson-xs-perl - liblinux-epoll-perl - mosquitto - name: Install mqtt-simple community.general.cpanm: name: "Net::MQTT::Simple" - name: Clone mqtt2web source ansible.builtin.git: repo: https://github.com/bitlair/mqtt2web.git version: master dest: /opt/mqtt2web accept_hostkey: true notify: Restart mqtt2web - name: Install mqtt2web service file ansible.builtin.template: src: mqtt2web.service dest: /etc/systemd/system/mqtt2web.service owner: root group: root mode: 0644 notify: - Daemon reload - Restart mqtt2web - name: Flush handlers ansible.builtin.meta: flush_handlers - name: Enable mqtt2web ansible.builtin.systemd: name: mqtt2web state: started enabled: true