ansible/playbooks/install_mqtt_srv.yml

39 lines
1.0 KiB
YAML
Raw Normal View History

2024-06-08 22:23:49 +02:00
- hosts: datacenter
name: Install mqtt_srv
ignore_unreachable: false
2024-06-08 22:29:12 +02:00
become: True
2024-06-08 22:23:49 +02:00
tasks:
2024-06-27 00:19:16 +02:00
- name: Install bottle python package
ansible.builtin.apt:
name:
- python3-pip
- python3-pip
- python3-pip
- python3-pip
- python3-pip
2024-06-08 22:23:49 +02:00
- 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/
2024-06-08 22:31:52 +02:00
mode: '755'
2024-06-08 22:34:41 +02:00
owner: root
- name: Install bottle python package
2024-06-27 00:19:16 +02:00
ansible.builtin.shell: pip install {{ item }} --break-system-packages
loop:
- paho-mqtt
- getmac
- ping3
- psutil
- autorandr
2024-06-08 23:47:29 +02:00
- 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