ansible/playbooks/install_mqtt_srv.yml
2024-06-08 23:47:29 +02:00

31 lines
824 B
YAML

- hosts: datacenter
name: Install mqtt_srv
ignore_unreachable: false
become: True
tasks:
- name: Upload service config
ansible.builtin.copy:
src: services/mqtt_srv.service
dest: /etc/systemd/system/
- name: Upload service script
ansible.builtin.copy:
src: scripts/mqtt_srv.py
dest: /usr/bin/
mode: '755'
owner: root
- name: Install bottle python package
ansible.builtin.pip:
name:
- paho-mqtt
- getmac
- ping3
- psutil
- autorandr
- name: Just force systemd to reread configs (2.4 and above)
ansible.builtin.systemd:
daemon_reload: true
- name: Restart mqtt_srv service
ansible.builtin.service:
name: mqtt_srv.service
state: restarted