diff --git a/playbooks/connection_test.yaml b/playbooks/connection_test.yaml new file mode 100644 index 0000000..71a1ed4 --- /dev/null +++ b/playbooks/connection_test.yaml @@ -0,0 +1,7 @@ +--- +- name: connection test + hosts: all + tasks: + - name: debug + ansible.builtin.debug: + var: ansible_connection diff --git a/playbooks/reboot_test.yaml b/playbooks/reboot_test.yaml new file mode 100644 index 0000000..80f09c5 --- /dev/null +++ b/playbooks/reboot_test.yaml @@ -0,0 +1,15 @@ +--- +- name: reboot test + hosts: all + tasks: + - name: debug before + ansible.builtin.debug: + msg: before + + - name: reboot + ansible.builtin.include_role: + name: reboot + + - name: debug after + ansible.builtin.debug: + msg: after diff --git a/roles/apt_update_and_upgrade/handlers/main.yaml b/roles/apt_update_and_upgrade/handlers/main.yaml index 17f19f1..001bbe4 100644 --- a/roles/apt_update_and_upgrade/handlers/main.yaml +++ b/roles/apt_update_and_upgrade/handlers/main.yaml @@ -1,6 +1,3 @@ - name: reboot the system - ansible.builtin.include_role: - role: reboot - vars: - # Simply don't reboot on local connections and rely on proper handling of /var/run/reboot-required. - reboot__local_handling: ignore + become: true + ansible.builtin.reboot: