upt playbook

This commit is contained in:
jaydee 2024-07-09 00:21:30 +02:00
parent 9ac9ff0e45
commit 12cff6ca07

View File

@ -18,6 +18,7 @@
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Upload service script
ansible.builtin.copy:
src: scripts/mqtt_srv.py
@ -27,6 +28,25 @@
when: inventory_hostname not in groups['nas']
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Upload service script1
ansible.builtin.copy:
src: scripts/mqtt_srv.sh
dest: /jffs/scripts/mqtt_srv/
mode: '755'
owner: root
when: inventory_hostname in groups['router']
become: false
- name: Upload service script
ansible.builtin.copy:
src: scripts/mqtt_srv.py
dest: /jffs/scripts/mqtt_srv/
mode: '755'
owner: root
when: inventory_hostname not in groups['router']
become: false
- name: Upload service script1
ansible.builtin.copy:
src: scripts/mqtt_srv.sh
@ -77,7 +97,13 @@
poll: 0
when: inventory_hostname in groups['nas']
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Restart mqtt service
ansible.builtin.shell: "(/jffs/scripts/mqtt_srv/mqtt_srv.sh restart >/dev/null 2>&1 &)"
async: 10
poll: 0
when: inventory_hostname in groups['router']
become: false