This commit is contained in:
2025-05-06 18:15:06 +02:00
parent 9e3ce2e113
commit d2c7c49d68

View File

@ -47,6 +47,15 @@
mode: '0755' mode: '0755'
owner: root owner: root
group: root group: root
- name: Create dir
ansible.builtin.file:
path: /myapps/mqtt_srv/
state: directory
mode: '0755'
owner: root
group: root
- name: Upload service script config - name: Upload service script config
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ dest_folder }}/mqtt_srv.cfg" src: "{{ dest_folder }}/mqtt_srv.cfg"
@ -91,21 +100,21 @@
- name: Upload service script2 - name: Upload service script2
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ dest_folder }}/mqtt_srv.py" src: "{{ dest_folder }}/mqtt_srv.py"
dest: /usr/bin/mqtt_srv.py dest: /myapps/mqtt_srv/mqtt_srv.py
mode: '755' mode: '755'
owner: admin owner: admin
remote_src: true remote_src: true
when: inventory_hostname == 'nas.home.lan' when: inventory_hostname == 'nas.home.lan'
- name: Install bottle python package - name: Install venv
ansible.builtin.apt:
name:
- python3-virtualenv
- name: Install specified python requirements in indicated (virtualenv)
ansible.builtin.pip: ansible.builtin.pip:
name: "{{ item }}" requirements: /myapps/mqtt_srv/requirements.txt
loop: virtualenv: /myapps/mqtt_srv/venv
- paho-mqtt
- getmac
- ping3
- psutil
- autorandr
when: inventory_hostname != 'nas.home.lan' when: inventory_hostname != 'nas.home.lan'
- name: Just force systemd to reread configs (2.4 and above) - name: Just force systemd to reread configs (2.4 and above)