From e0945fec0543c1cd9b8dcfeef96ea2d181a6d3db Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 22:39:36 +0200 Subject: [PATCH] upt playbook --- playbooks/install_mqtt_srv.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index c3fad54..51dfbc7 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -27,10 +27,19 @@ when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Upload service script + - name: Upload service script1 + ansible.builtin.copy: + src: scripts/mqtt_srv.sh + dest: /etc/init.d/ + mode: '755' + owner: admin + when: inventory_hostname in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Upload service script2 ansible.builtin.copy: src: scripts/mqtt_srv.py - dest: /share/Data/__GITLAB/mqtt_srv/ + dest: /usr/bin/ mode: '755' owner: admin when: inventory_hostname in groups['nas'] @@ -63,7 +72,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package1 - ansible.builtin.shell: "(/etc/init.d/mqtt restart >/dev/null 2>&1 &)" + ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)" async: 10 poll: 0 when: inventory_hostname in groups['nas']