diff --git a/playbooks/aptupdates.yml b/playbooks/aptupdates.yml index 9a65da4..06b09aa 100644 --- a/playbooks/aptupdates.yml +++ b/playbooks/aptupdates.yml @@ -5,8 +5,8 @@ tasks: - name: Update apt packages apt: - upgrade: dist update_cache: yes + upgrade: dist - name: Check if reboot is needed stat: @@ -20,4 +20,9 @@ app_token: '{{ app_token }}' user_key: '{{ user_key }}' delegate_to: localhost + when: reboot_required.stat.exists + + - name: Give reboot notification + ansible.builtin.debug: + msg: "Reboot is required on {{ inventory_hostname }}" when: reboot_required.stat.exists \ No newline at end of file