forked from DouglasNeuroInformatics/ansible-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.yml
More file actions
46 lines (36 loc) · 1.16 KB
/
update.yml
File metadata and controls
46 lines (36 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
- hosts:
- workstations
- computenodes
become: yes
tasks:
- name: Gather logged in user
shell:
cmd: who | cut -d " " -f 1 | sort | uniq
register: numusers
changed_when: false
check_mode: false
- name: update apt-get cache
apt: update_cache=yes
- name: Install kernel and nvidia and hold packages
ansible.builtin.script: bin/install_kernel.sh
when: numusers.stdout_lines | length < 2
- name: safe-upgrade
apt: upgrade=safe cache_valid_time=3600 autoclean=yes autoremove=yes
- name: full-upgrade
apt: upgrade=full cache_valid_time=3600 autoclean=yes autoremove=yes
- name: update-pciids
command: update-pciids
- name: update-initram-fs
command: update-initramfs -k all -c
- name: update-grub
command: update-grub
- name: update-smart-drive-db
command: update-smart-drivedb
- name: purge old configs
shell: "dpkg -l | grep '^rc' | awk '{print $2}' | xargs --no-run-if-empty dpkg --purge"
ignore_errors: yes
- name: reboot if required
reboot:
reboot_timeout: 150
when: numusers.stdout_lines | length < 2