Skip to content

Commit ff589c8

Browse files
authored
Merge pull request #11 from Diesel-Net/development
Add apt update tasks list
2 parents d6c4163 + 894ad29 commit ff589c8

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

defaults/main.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# safe/sane defaults
2+
3+
auto_reboots: no

tasks/update.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- name: sudo apt update && sudo apt upgrade -y
2+
apt:
3+
update-cache: yes
4+
upgrade: safe
5+
become: yes
6+
7+
- block:
8+
9+
- name: Check to see if restart is required (kernel updates)
10+
stat:
11+
path: /var/run/reboot-required
12+
register: reboot_required
13+
14+
- name: Reboot the system
15+
shell: sleep 5 && reboot
16+
become: yes
17+
async: 10
18+
poll: 0
19+
when: reboot_required.stat.exists
20+
21+
- name: Wait for system to become reachable again
22+
wait_for_connection:
23+
delay: 60
24+
timeout: 300
25+
when: reboot_required.stat.exists
26+
27+
when: auto_reboots

0 commit comments

Comments
 (0)