From 1c8f7e7431d24cfea1db6804e42e70d373e38651 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:32:15 +0200 Subject: [PATCH] upt playbook --- playbooks/install_mqtt_srv.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 2df0a40..45318b5 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -14,7 +14,7 @@ ansible.builtin.copy: src: services/mqtt_srv.service dest: /etc/systemd/system/ - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" @@ -25,7 +25,7 @@ dest: /usr/bin/ mode: '755' owner: root - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service script1 @@ -44,7 +44,7 @@ dest: /jffs/scripts/mqtt_srv/ mode: '755' owner: root - when: inventory_hostname not in groups['router'] + when: inventory_hostname in groups['router'] become: false - name: Upload service script1 @@ -73,14 +73,14 @@ - ping3 - psutil - autorandr - when: inventory_hostname not in groups['nas','router'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas','router'] else 'yes' }}" - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd: daemon_reload: true - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" @@ -88,7 +88,7 @@ ansible.builtin.service: name: mqtt_srv.service state: restarted - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Restart mqtt service