From 32835c2c45c33e00da8c53167e531fee97c567f7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:37:22 +0200 Subject: [PATCH] bitwarden --- playbooks/install_mqtt_srv.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 5d97995..20fec05 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,18 +1,19 @@ - hosts: datacenter name: Install mqtt_srv ignore_unreachable: false - become: True tasks: - name: Install bottle python package ansible.builtin.apt: name: - python3-pip when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service config ansible.builtin.copy: src: services/mqtt_srv.service dest: /etc/systemd/system/ when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py @@ -20,6 +21,7 @@ mode: '755' owner: root when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package ansible.builtin.shell: pip install {{ item }} --break-system-packages loop: @@ -29,12 +31,15 @@ - psutil - autorandr when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] 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'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Restart mqtt_srv service ansible.builtin.service: name: mqtt_srv.service state: restarted - when: inventory_hostname not in groups['nas'] \ No newline at end of file + when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" \ No newline at end of file