1
0
Fork 0
mirror of https://github.com/samsapti/bachelor-project.git synced 2024-12-27 21:07:53 +00:00

Reboot host if needed

This commit is contained in:
Sam A. 2023-04-19 18:46:41 +02:00
parent 34b99a8adf
commit feebc113e8
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -10,6 +10,16 @@
update_cache: true
upgrade: full
- name: Check if a reboot is needed
ansible.builtin.stat:
path: /var/run/reboot-required
register: needs_reboot
- name: Reboot host
ansible.builtin.reboot:
when: needs_reboot.stat.exists or
(force_reboot is defined and force_reboot)
- name: Create user {{ username }}
ansible.builtin.user:
name: "{{ username }}"