forked from NLNOG/ring-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubuntu_upgrade.yml
75 lines (66 loc) · 1.86 KB
/
ubuntu_upgrade.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
- hosts: all
become: true
become_user: root
roles:
- { role: apt, tags: apt }
- { role: ansible, tags: ansible, mitogen: no }
tasks:
- name: "Configure temporary dpkg options"
copy:
dest: /etc/apt/apt.conf.d/local
mode: 0644
content: 'DPkg::options { "--force-confold"; }'
- name: "Disable ansible cron"
file:
name=/etc/cron.d/ansible
state=absent
- name: "Run apt-get dist-upgrade once for the current release"
apt:
upgrade: dist
update_cache: yes
tags:
- prepare
- hosts: all
become: true
become_user: root
tasks:
- name: "Remove automatic update files"
file: name={{ item }} state=absent
with_items:
- /etc/apt/apt.conf.d/50unattended-upgrades
- /etc/apt/apt.conf.d/50unattended-upgrades.dpkg-dist
- name: "Perform release upgrade (xenial -> bionic)"
command: do-release-upgrade -f DistUpgradeViewNonInteractive
when: ansible_distribution_release == "xenial"
- name: "Remove daemontools"
apt: name={{ item }} state=absent
with_items:
- daemontools
tags:
- bionic
- hosts: all
become: true
become_user: root
roles:
- { role: apt, tags: apt }
- { role: ansible, tags: ansible, mitogen: no }
tasks:
- name: "Remove temporary dpkg configuration"
file:
name: /etc/apt/apt.conf.d/local
state: absent
- name: "Remove spurious automatic update file"
file: name={{ item }} state=absent
with_items:
- /etc/apt/apt.conf.d/50unattended-upgrades.dpkg-dist
- name: "Remove old virtual environments"
file: name={{ item }} state=absent
with_items:
- /usr/share/ripe-atlas-venv
tags:
- cleanup
- hosts: ringnode
become: true
become_user: root
roles:
- { role: users, class: ring-users, tags: ring-users }